Constructor and Description |
---|
Version(int... parts)
Creates a new
Version from the given integer values. |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Version that) |
boolean |
equals(java.lang.Object obj) |
int |
hashCode() |
boolean |
is(Version version)
Returns whether the current
Version is the same as the given one. |
boolean |
isGreaterThan(Version version)
Returns whether the current
Version is greater (newer) than the given one. |
boolean |
isGreaterThanOrEqualTo(Version version)
Returns whether the current
Version is greater (newer) or the same as the given one. |
boolean |
isLessThan(Version version)
Returns whether the current
Version is less (older) than the given one. |
boolean |
isLessThanOrEqualTo(Version version)
Returns whether the current
Version is less (older) or equal to the current one. |
static Version |
parse(java.lang.String version)
Parses the given string representation of a version into a
Version object. |
java.lang.String |
toString() |
public Version(int... parts)
Version
from the given integer values. At least one value has to be given but a maximum of 4.parts
- must not be null or empty.public static Version parse(java.lang.String version)
Version
object.version
- must not be null or empty.public boolean isGreaterThan(Version version)
Version
is greater (newer) than the given one.version
- - candidate versionpublic boolean isGreaterThanOrEqualTo(Version version)
Version
is greater (newer) or the same as the given one.version
- - candidate versionpublic boolean is(Version version)
Version
is the same as the given one.version
- - candidate versionpublic boolean isLessThan(Version version)
Version
is less (older) than the given one.version
- - candidate versionpublic boolean isLessThanOrEqualTo(Version version)
Version
is less (older) or equal to the current one.version
- - candidate versionpublic int compareTo(Version that)
compareTo
in interface java.lang.Comparable<Version>
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object