Package org.pepsoft.util
Class Version
java.lang.Object
org.pepsoft.util.Version
- All Implemented Interfaces:
Serializable,Comparable<Version>
A version number in decimal dotted notation, with an optional alphanumerical
extension separated by a dash.
When comparing the extension is only considered if the versions being compared are numerically equal, where a version with an extension is considered smaller than a version without an extension, and if both versions have an extension they are compared alphanumerically.
- See Also:
-
Constructor Details
-
Version
public Version(int... parts) -
Version
-
Version
-
Version
-
Version
-
-
Method Details
-
getParts
public int[] getParts() -
getExtension
-
isAtLeast
-
compareTo
- Specified by:
compareToin interfaceComparable<Version>
-
hashCode
public int hashCode() -
equals
-
toString
-
parse
Create a newVersionfrom a string of the formx.y.zorx.y.z-EXT(with any number of parts).- Parameters:
str- The string to parse.- Returns:
- The resulting Version object.
- Throws:
NumberFormatException- If there are non-numeric characters in the string.
-