public class VersionNumber extends Object implements Comparable<VersionNumber>
VersionNumbers are Comparable.
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.0This class is re-implemented in 1.415. The class was originally introduced in 1.139
| Modifier and Type | Field and Description |
|---|---|
static Comparator<VersionNumber> |
DESCENDING |
| Constructor and Description |
|---|
VersionNumber(String version) |
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(VersionNumber o) |
int |
digit(int idx)
Deprecated.
see
getDigitAt(int) |
boolean |
equals(Object o) |
int |
getDigitAt(int idx)
Returns a digit (numeric component) by its position.
|
int |
hashCode() |
boolean |
isNewerThan(VersionNumber rhs) |
boolean |
isOlderThan(VersionNumber rhs) |
String |
toString() |
public static final Comparator<VersionNumber> DESCENDING
public VersionNumber(String version)
public int compareTo(VersionNumber o)
compareTo in interface Comparable<VersionNumber>public boolean isOlderThan(VersionNumber rhs)
public boolean isNewerThan(VersionNumber rhs)
public int digit(int idx)
getDigitAt(int)public int getDigitAt(int idx)
idx - Digit position we want to retrieve starting by 0.Copyright © 2004-2017. All Rights Reserved.