Package megamek
Class Version
java.lang.Object
megamek.Version
- All Implemented Interfaces:
Serializable
,Comparable<Version>
This is used for versioning, and to track the current Version the suite is running at.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
boolean
getExtra()
int
getMajor()
int
getMinor()
int
getPatch()
int
hashCode()
boolean
boolean
boolean
boolean
boolean
isHigherThan
(String other) Deprecated, for removal: This API element is subject to removal in a future version.boolean
isHigherThan
(Version other) Use this method to determine if the version passed is less than this Version object.boolean
isLowerThan
(String other) Deprecated, for removal: This API element is subject to removal in a future version.useinstead
boolean
isLowerThan
(Version other) Use this method to determine if this version is lower than the version passedvoid
void
setMajor
(int major) void
setMinor
(int minor) void
setPatch
(int patch) toString()
void
writeToXML
(PrintWriter pw, int indent)
-
Constructor Details
-
Version
public Version()This Constructor is not to be used outside of unit testing -
Version
Sets the version with Extra data.- Parameters:
text
- The Version string to parse.
-
Version
public Version(int major, int minor, int patch) Sets the version.- Parameters:
major
- Major Versionminor
- Minor Versionpatch
- Patch Version
-
Version
Sets the version.- Parameters:
major
- Major Versionminor
- Minor Versionpatch
- Patch Version
-
Version
Sets the version with Extra data.- Parameters:
major
- Major Versionminor
- Minor Versionpatch
- Patch Versionextra
- Extra would be PR or nightly with git hash.
-
-
Method Details
-
getMajor
public int getMajor() -
setMajor
public void setMajor(int major) -
getMinor
public int getMinor() -
setMinor
public void setMinor(int minor) -
getPatch
public int getPatch() -
setPatch
public void setPatch(int patch) -
getExtra
-
setExtra
-
isHigherThan
Deprecated, for removal: This API element is subject to removal in a future version.useisHigherThan(Version)
instead.Use this method to determine if this version is higher than the version passed- Parameters:
other
- The version we want to see if it is lower than this version- Returns:
- true if this is higher than checkVersion
-
isHigherThan
Use this method to determine if the version passed is less than this Version object.- Parameters:
other
- The version we want to see if is less than this version- Returns:
- true if checkVersion is less than this Version object
-
isLowerThan
Deprecated, for removal: This API element is subject to removal in a future version.useinstead
Use this method to determine if this version is lower than the version passed- Parameters:
other
- The version we want to see if it is higher than this version.- Returns:
- true if this is lower than checkVersion
-
isLowerThan
Use this method to determine if this version is lower than the version passed- Parameters:
other
- The version we want to see if it is higher than this version.- Returns:
- true if this is lower than checkVersion
-
isBetween
- Parameters:
lower
- the lower Version bound (exclusive)upper
- the upper Version bound (exclusive)- Returns:
- true if the version is between lower and upper versions, both exclusive
-
isBetween
- Parameters:
lower
- the lower Version bound (exclusive)upper
- the upper Version bound (exclusive)- Returns:
- true is the version is between lower and upper versions, both exclusive
-
is
- Parameters:
other
- The version we want to see if it is the same as this version.- Returns:
- true if this is same version as the other
-
is
- Parameters:
other
- The version we want to see if it is the same as this version.- Returns:
- true if this is same version as the other
-
compareTo
- Specified by:
compareTo
in interfaceComparable<Version>
-
equals
-
hashCode
public int hashCode() -
writeToXML
-
toString
-
isHigherThan(Version)
instead.