Package aQute.bnd.version.maven
Class ComparableVersion.StringItem
java.lang.Object
aQute.bnd.version.maven.ComparableVersion.StringItem
- All Implemented Interfaces:
ComparableVersion.Item
- Enclosing class:
- ComparableVersion
Represents a string in the version item list, usually a qualifier.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Properties
private static final String
A comparable value for the empty-string qualifier.private final String
Fields inherited from interface aQute.bnd.version.maven.ComparableVersion.Item
BIGINTEGER_ITEM, INT_ITEM, LIST_ITEM, LONG_ITEM, STRING_ITEM
-
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
QUALIFIERS
-
ALIASES
-
RELEASE_VERSION_INDEX
A comparable value for the empty-string qualifier. This one is used to determine if a given qualifier makes the version older than one without a qualifier, or more recent. -
value
-
-
Constructor Details
-
StringItem
StringItem(String value, boolean followedByDigit)
-
-
Method Details
-
getType
public int getType()- Specified by:
getType
in interfaceComparableVersion.Item
-
isNull
public boolean isNull()- Specified by:
isNull
in interfaceComparableVersion.Item
-
comparableQualifier
Returns a comparable value for a qualifier. This method takes into account the ordering of known qualifiers then unknown qualifiers with lexical ordering. just returning an Integer with the index here is faster, but requires a lot of if/then/else to check for -1 or QUALIFIERS.size and then resort to lexical ordering. Most comparisons are decided by the first character, so this is still fast. If more characters are needed then it requires a lexical sort anyway.- Parameters:
qualifier
-- Returns:
- an equivalent value that can be used with lexical comparison
-
compareTo
- Specified by:
compareTo
in interfaceComparableVersion.Item
-
equals
-
hashCode
public int hashCode() -
toString
-