Package org.spongepowered.asm.util
Class VersionNumber
java.lang.Object
org.spongepowered.asm.util.VersionNumber
- All Implemented Interfaces:
Serializable,Comparable<VersionNumber>
Represents a software version number in
major.minor.revision.build
format as a sequence of four shorts packed into a long. This is to
facilitate meaningful comparison between version numbers.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final VersionNumberRepresents no version number or a version number which could not be parsed -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(VersionNumber other) booleanshortgetMajor()Get the major version from this version numbershortgetMinor()Get the minor version from this version numbershortgetPatch()Get the patch from this version numbershortGet the revision from this version numberGet the suffix from this versioninthashCode()static VersionNumberParse a version number specified as a stringstatic VersionNumberParse a version number specified as a string and return default if parsing failstoString()
-
Field Details
-
NONE
Represents no version number or a version number which could not be parsed
-
-
Method Details
-
getMajor
public short getMajor()Get the major version from this version number -
getMinor
public short getMinor()Get the minor version from this version number -
getPatch
public short getPatch()Get the patch from this version number -
getRevision
public short getRevision()Get the revision from this version number -
getSuffix
Get the suffix from this version -
toString
-
compareTo
- Specified by:
compareToin interfaceComparable<VersionNumber>
-
equals
-
hashCode
public int hashCode() -
parse
Parse a version number specified as a string- Parameters:
version- Version number to parse- Returns:
- Version number
-
parse
Parse a version number specified as a string and return default if parsing fails- Parameters:
version- Version number to parsedefaultVersion- Version number to return if parse fails- Returns:
- Version number
-