Package aQute.bnd.version.maven
Class ComparableVersion
java.lang.Object
aQute.bnd.version.maven.ComparableVersion
- All Implemented Interfaces:
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.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classRepresents a numeric item in the version item list.private static classRepresents a numeric item in the version item list that can be represented with an int.private static interfaceprivate static classRepresents a version list item.private static classRepresents a numeric item in the version item list that can be represented with a long.private static classRepresents a string in the version item list, usually a qualifier. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Stringprivate ComparableVersion.ListItemprivate static final intprivate static final intprivate String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintbooleaninthashCode()private static ComparableVersion.Itemfinal voidparseVersion(String version) private static StringstripLeadingZeroes(String buf) toString()
-
Field Details
-
MAX_INTITEM_LENGTH
private static final int MAX_INTITEM_LENGTH- See Also:
-
MAX_LONGITEM_LENGTH
private static final int MAX_LONGITEM_LENGTH- See Also:
-
value
-
canonical
-
items
-
-
Constructor Details
-
ComparableVersion
-
-
Method Details
-
parseVersion
-
parseItem
-
stripLeadingZeroes
-
compareTo
- Specified by:
compareToin interfaceComparable<ComparableVersion>
-
toString
-
getCanonical
-
equals
-
hashCode
public int hashCode()
-