|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.datastax.driver.core.VersionNumber
public class VersionNumber
A version number in the form X.Y.Z with an optional pre-release label (like 1.2.14-SNAPSHOT).
Version numbers compare the usual way, the major number (X) is compared first, then the minor one (Y) and then the patch level one (Z). Lastly, versions with pre-release sorts before the versions that don't have one, and labels are sorted alphabetically if necessary.
Method Summary | |
---|---|
int |
compareTo(VersionNumber other)
|
boolean |
equals(Object o)
|
int |
getMajor()
The major version number. |
int |
getMinor()
The minor version number. |
int |
getPatch()
The patch version number. |
String |
getPreReleaseLabel()
The pre-release label if relevant, i.e. |
int |
hashCode()
|
static VersionNumber |
parse(String version)
Parse a version from a string (of the form X.Y.Z[-label]). |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public static VersionNumber parse(String version)
We also parse shorter versions like X.Y[-label] for convenience, but this parse the same as X.Y.0[-label].
version
- the string to parse
IllegalArgumentException
- if the provided string does not
represent a valid versionpublic int getMajor()
public int getMinor()
public int getPatch()
public String getPreReleaseLabel()
null
if the version number
doesn't have one.public int compareTo(VersionNumber other)
compareTo
in interface Comparable<VersionNumber>
public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |