Package qupath.lib.common
Class Version
java.lang.Object
qupath.lib.common.Version
- All Implemented Interfaces:
- Comparable<Version>
Helper class for working with semantic versioning.
 
 This should be in the form major.minor.patch.
 An optional suffix is also permitted to indicate a pre-release, alpha, beta or milestone version,
 in the form major.minor.patch-suffix, where the suffix may contain any alphanumeric characters or periods.
 
Implementation note: No checking is currently performed to ensure any suffix conforms to semantic versioning standards - however this behavior may change.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final Comparator<Version> Compare full version, including any suffixes.static final Comparator<Version> Compare major versions only.static final Comparator<Version> Compare major then minor versions.static final Comparator<Version> Compare major then minor then patch versions (ignoring suffixes).static final VersionConstant representing any unknown version.
- 
Method SummaryModifier and TypeMethodDescriptionintbooleanintgetMajor()Get the major version number (X.0.0).intgetMinor()Get the minor version number (0.X.0).intgetPatch()Get the patch version number (0.0.X).Get the (optional) suffix, which may be appended at the end of the version number to indicate a pre-release (0.0.0-X).inthashCode()booleanReturns true if the version has a suffix, which typically indicates that it does not refer to a final stable version.static VersionParse aVersionobject representing a semantic version number from a String.toString()
- 
Field Details- 
COMPARATOR_MAJORCompare major versions only.
- 
COMPARATOR_MAJOR_MINORCompare major then minor versions.
- 
COMPARATOR_MAJOR_MINOR_PATCHCompare major then minor then patch versions (ignoring suffixes).
- 
COMPARATOR_FULLCompare full version, including any suffixes.
- 
UNKNOWNConstant representing any unknown version.
 
- 
- 
Method Details- 
getMajorpublic int getMajor()Get the major version number (X.0.0).- Returns:
 
- 
getMinorpublic int getMinor()Get the minor version number (0.X.0).- Returns:
 
- 
getPatchpublic int getPatch()Get the patch version number (0.0.X).- Returns:
 
- 
getSuffixGet the (optional) suffix, which may be appended at the end of the version number to indicate a pre-release (0.0.0-X).- Returns:
 
- 
hasSuffixpublic boolean hasSuffix()Returns true if the version has a suffix, which typically indicates that it does not refer to a final stable version.- Returns:
 
- 
toString
- 
parseParse aVersionobject representing a semantic version number from a String.The version should be in the form x.y.zorx.y.z-additional, whereadditionalshould be a dot-separated patch version identifier. In the case that it is hyphen-separated, the hyphens will be replaced by dots.- Parameters:
- versionString- the version String to be parsed
- Returns:
- a Version parsed from this string, or UNKNOWNif the string is null or blank.
- Throws:
- IllegalArgumentException- if no version could be parsed from the String
 
- 
compareTo- Specified by:
- compareToin interface- Comparable<Version>
 
- 
hashCodepublic int hashCode()
- 
equals
 
-