public final class Version extends Object implements Comparable<Version>
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(Version object) |
boolean |
equals(Object object) |
int |
getMajor() |
int |
getMinor() |
int |
hashCode()
Returns a hash code value for the object.
|
static Version |
parseVersion(String version)
Creates a
Version instance by parsing the given version string. |
String |
toString() |
public int getMajor()
public int getMinor()
public static Version parseVersion(String version) throws IllegalArgumentException, NumberFormatException
Version instance by parsing the given version string. The format is defined
as:
version ::= major('.'minor)?
major ::= digit+
minor ::= digit+
digit ::= [0-9]
version - The string represenation of a version.Version instance, or 0.0 version on error.IllegalArgumentException - When the given format is invalid.NumberFormatException - When the major or minor component is not an integer.public int hashCode()
public int compareTo(Version object)
compareTo in interface Comparable<Version>