public class Version extends Object
Version identifiers have four components:
Constructor and Description |
---|
Version(int major,
int minor,
int build,
int mmVersion)
Instanciate a new Version from its component.
|
Version(String versionString)
Instanciate a new Version from a String.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object anObject)
Compares this Version to the specified object.
|
int |
getBuildVersion()
Get the build number of this version
|
int |
getMajorVersion()
Get the major number of this version.
|
int |
getMetamodelVersion()
Get the metamodel number of this version.
|
int |
getMinorVersion()
Get the minor number of this version.
|
int |
hashCode() |
boolean |
isNewerThan(Version other)
Check if this Version is newer than the given Version.
|
boolean |
isOlderThan(Version other)
Check if this Version is older than the given Version
|
String |
toString()
Provides a formatted string representation of the version.
|
public Version(int major, int minor, int build, int mmVersion)
major
- the first component of the version.minor
- the second component of the version.build
- the third component of the version.mmVersion
- the last component of the version.public Version(String versionString) throws NumberFormatException
versionString
- The String to parse to create the version.NumberFormatException
- thrown when the parameter doesn't have a valid format.public boolean equals(Object anObject)
The result is true if and only if the argument is not null and is a Version object that represents the same version object as this object.
public int getBuildVersion()
public int getMajorVersion()
public int getMetamodelVersion()
public int getMinorVersion()
public boolean isNewerThan(Version other)
other
- the Version object that must be compared to this Version.public boolean isOlderThan(Version other)
other
- the Version object that must be compared to this Version.public String toString()
The format is: V.R.CC.mmmm where: