Package pro.taskana.common.internal.util
Class ComparableVersion
- java.lang.Object
-
- pro.taskana.common.internal.util.ComparableVersion
-
- All Implemented Interfaces:
Comparable<ComparableVersion>
public class ComparableVersion extends Object implements Comparable<ComparableVersion>
Generic implementation of version comparison. Features:- mixing of '
-' (hyphen) and '.' (dot) separators, - transition between characters and digits also constitutes a separator:
1.0alpha1 => [1, 0, alpha, 1] - unlimited number of version components,
- version components in the text can be digits or strings,
- strings are checked for well-known qualifiers and the qualifier ordering is used for
version ordering. Well-known qualifiers (case insensitive) are:
alphaorabetaorbmilestoneormrcorcrsnapshot(the empty string)orgaorfinalsp
- a hyphen usually precedes a qualifier, and is always less important than something preceded with a dot.
- Author:
- Kenney Westerhof, Hervé Boutemy
- See Also:
- "Versioning" on Maven Wiki
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(ComparableVersion o)booleanequals(Object o)StringgetCanonical()inthashCode()static ComparableVersionof(String version)voidparseVersion(String version)StringtoString()
-
-
-
Method Detail
-
of
public static ComparableVersion of(String version)
-
parseVersion
public final void parseVersion(String version)
-
compareTo
public int compareTo(ComparableVersion o)
- Specified by:
compareToin interfaceComparable<ComparableVersion>
-
getCanonical
public String getCanonical()
-
-