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
private static class ComparableVersion.StringItem extends java.lang.Object implements ComparableVersion.Item
Represents a string in the version item list, usually a qualifier.
-
-
Field Summary
Fields Modifier and Type Field Description private static java.util.Properties
ALIASES
private static java.util.List<java.lang.String>
QUALIFIERS
private static java.lang.String
RELEASE_VERSION_INDEX
A comparable value for the empty-string qualifier.private java.lang.String
value
-
Fields inherited from interface aQute.bnd.version.maven.ComparableVersion.Item
BIGINTEGER_ITEM, INT_ITEM, LIST_ITEM, LONG_ITEM, STRING_ITEM
-
-
Constructor Summary
Constructors Constructor Description StringItem(java.lang.String value, boolean followedByDigit)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.lang.String
comparableQualifier(java.lang.String qualifier)
Returns a comparable value for a qualifier.int
compareTo(ComparableVersion.Item item)
boolean
equals(java.lang.Object o)
int
getType()
int
hashCode()
boolean
isNull()
java.lang.String
toString()
-
-
-
Field Detail
-
QUALIFIERS
private static final java.util.List<java.lang.String> QUALIFIERS
-
ALIASES
private static final java.util.Properties ALIASES
-
RELEASE_VERSION_INDEX
private static final java.lang.String 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
private final java.lang.String value
-
-
Method Detail
-
getType
public int getType()
- Specified by:
getType
in interfaceComparableVersion.Item
-
isNull
public boolean isNull()
- Specified by:
isNull
in interfaceComparableVersion.Item
-
comparableQualifier
public static java.lang.String comparableQualifier(java.lang.String qualifier)
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
public int compareTo(ComparableVersion.Item item)
- Specified by:
compareTo
in interfaceComparableVersion.Item
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-