public final class VersionNumber extends java.lang.Object implements java.lang.Comparable<VersionNumber>, java.io.Serializable
major.minor.revision.build
format as a sequence of four shorts packed into a long. This is to
facilitate meaningful comparison between version numbers.| Modifier and Type | Field and Description |
|---|---|
static VersionNumber |
NONE
Represents no version number or a version number which could not be
parsed
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(VersionNumber other) |
boolean |
equals(java.lang.Object other) |
short |
getMajor()
Get the major version from this version number
|
short |
getMinor()
Get the minor version from this version number
|
short |
getPatch()
Get the patch from this version number
|
short |
getRevision()
Get the revision from this version number
|
java.lang.String |
getSuffix()
Get the suffix from this version
|
int |
hashCode() |
static VersionNumber |
parse(java.lang.String version)
Parse a version number specified as a string
|
static VersionNumber |
parse(java.lang.String version,
java.lang.String defaultVersion)
Parse a version number specified as a string and return default if
parsing fails
|
java.lang.String |
toString() |
public static final VersionNumber NONE
public short getMajor()
public short getMinor()
public short getPatch()
public short getRevision()
public java.lang.String getSuffix()
public java.lang.String toString()
toString in class java.lang.Objectpublic int compareTo(VersionNumber other)
compareTo in interface java.lang.Comparable<VersionNumber>public boolean equals(java.lang.Object other)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic static VersionNumber parse(java.lang.String version)
version - Version number to parsepublic static VersionNumber parse(java.lang.String version, java.lang.String defaultVersion)
version - Version number to parsedefaultVersion - Version number to return if parse fails