public class Version extends Object implements Serializable, Comparable<Version>
Modifier and Type | Field and Description |
---|---|
static Version |
MAX |
static Version |
MIN |
static Version |
ZERO |
Constructor and Description |
---|
Version(int major,
int minor,
int update)
Creates a new version object given the major, minor and update version numbers.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Version v) |
boolean |
equals(Object object) |
int |
getMajorVersion()
Gets the major version field.
|
int |
getMinorVersion()
Gets the minor version field.
|
int |
getUpdateVersion()
Gets the update version field.
|
int |
hashCode() |
boolean |
isEqualTo(Version version)
Tests if the current version is equal to the given one.
|
boolean |
isGreaterOrEqualThan(Version version)
Tests if the current version is greater or equal to the given one.
|
boolean |
isGreaterThan(Version version)
Tests if the current version is greater than the given one.
|
static Version |
parseString(String version)
Creates a new version object given a string representation of the version.
|
String |
toString()
Gets the string representation of this version.
|
public Version(int major, int minor, int update)
major
- the major versionminor
- the minor versionupdate
- the update versionpublic static Version parseString(String version)
version
- the version stringNumberFormatException
- if the version string is invalidpublic boolean isGreaterThan(Version version)
version
- the version to compare to the current onepublic boolean isGreaterOrEqualThan(Version version)
version
- the version to compare to the current onepublic boolean isEqualTo(Version version)
version
- the version to compare to the current onepublic int getMinorVersion()
public int getMajorVersion()
public int getUpdateVersion()
public String toString()
The string representation can be used in parseString(String)
to create a version object.
public int compareTo(Version v)
compareTo
in interface Comparable<Version>
Copyright © 2017 Nuxeo. All rights reserved.