Class Version
java.lang.Object
nl.colorize.util.Version
- All Implemented Interfaces:
Comparable<Version>
Represents a version number with arbitrary precision. Examples of version
numbers that can be represented by this class are "1.0" and "1.6.0b31".
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanReturns true ifversionStringrepresents a version number that can be represented by this class.intCompares this version number toother.booleaninthashCode()booleanbooleanisNewerThan(Version other) booleanstatic VersionParses a version number from the specified version string.toString()Returns the version string that is represented by this object.
-
Field Details
-
UNKNOWN
-
-
Method Details
-
compareTo
Compares this version number toother. This will return one of the following values:- 1 if this version is newer than
other - -1 if this version is older than
other - 0 if both versions are equal
- Specified by:
compareToin interfaceComparable<Version>
- 1 if this version is newer than
-
isAtLeast
-
isNewerThan
-
isUnknown
public boolean isUnknown() -
equals
-
hashCode
-
toString
-
parse
Parses a version number from the specified version string. An empty string will returnUNKNOWN. A non-empty string that is not a valid version number will result in an exception.- Throws:
IllegalArgumentException- if the version string cannot be parsed.
-
canParse
Returns true ifversionStringrepresents a version number that can be represented by this class. In other words, this method indicates whetherparse(String)will throw an exception if invoked withversionString.
-