org.jvnet.hudson.maven.plugins.hpi
Class VersionNumber
java.lang.Object
org.jvnet.hudson.maven.plugins.hpi.VersionNumber
- All Implemented Interfaces:
- Comparable<VersionNumber>
public class VersionNumber
- extends Object
- implements Comparable<VersionNumber>
Immutable representation of a dot or '-'-separated digits (such as "1.0.1" or "1.0-52").
VersionNumbers are Comparable.
Special tokens
We allow a component to be not just a number, but also "ea", "ea1", "ea2".
"ea" is treated as "ea0", and eaN < M for any M > 0.
'*' is also allowed as a component, and '*' > M for any M > 0.
'SNAPSHOT' is also allowed as a component, and "N.SNAPSHOT" is interpreted as "N-1.*"
2.0.* > 2.0.1 > 2.0.1-SNAPSHOT > 2.0.0.99 > 2.0.0 > 2.0.ea > 2.0
- Since:
- 1.139
- Author:
- Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
|
Constructor Summary |
VersionNumber(String num)
Parses a string like "1.0.2" into the version number. |
VersionNumber
public VersionNumber(String num)
- Parses a string like "1.0.2" into the version number.
- Throws:
IllegalArgumentException - if the parsing fails.
toString
public String toString()
- Overrides:
toString in class Object
isOlderThan
public boolean isOlderThan(VersionNumber rhs)
isNewerThan
public boolean isNewerThan(VersionNumber rhs)
equals
public boolean equals(Object o)
- Overrides:
equals in class Object
hashCode
public int hashCode()
- Overrides:
hashCode in class Object
compareTo
public int compareTo(VersionNumber rhs)
- Specified by:
compareTo in interface Comparable<VersionNumber>
Copyright © 2011. All Rights Reserved.