Modifier and Type | Method and Description |
---|---|
int |
compareTo(Version that) |
static Version |
create(java.lang.Integer... components)
Creates a new version from components.
|
boolean |
equals(java.lang.Object o) |
java.lang.Integer |
getMajor()
Returns this version number's major component.
|
java.lang.Integer |
getMicro()
Returns this version number's micro component.
|
java.lang.Integer |
getMinor()
Returns this version number's minor component.
|
java.lang.Integer |
getPatch()
Returns this version number's patch component.
|
java.lang.Integer |
getRevision()
Returns this version number's revision component.
|
java.lang.String |
getVersion()
Returns this version as a string.
|
int |
hashCode() |
static Version |
parse(java.lang.String version)
Parses the passed version string.
|
java.lang.String |
toString() |
public static Version parse(java.lang.String version)
version
- the version string.public static Version create(java.lang.Integer... components)
components
- the componentspublic java.lang.Integer getMajor()
public java.lang.Integer getMinor()
null
if this version
number doesn't have a minor component.public java.lang.Integer getMicro()
null
if this version
number doesn't have a micro component.public java.lang.Integer getRevision()
null
if this version
number doesn't have a revision component.public java.lang.Integer getPatch()
null
if this version
number doesn't have a patch component.public java.lang.String getVersion()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int compareTo(Version that)
compareTo
in interface java.lang.Comparable<Version>
public java.lang.String toString()
toString
in class java.lang.Object