Class ComparableVersion.StringItem

java.lang.Object
org.apache.maven.artifact.versioning.ComparableVersion.StringItem
All Implemented Interfaces:
ComparableVersion.Item
Enclosing class:
ComparableVersion

private static class ComparableVersion.StringItem extends Object implements ComparableVersion.Item
Represents a string in the version item list, usually a qualifier.
  • Field Details

    • QUALIFIERS

      private static final List<String> QUALIFIERS
    • ALIASES

      private static final Properties ALIASES
    • RELEASE_VERSION_INDEX

      private static final 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 String value
  • Constructor Details

    • StringItem

      StringItem(String value, boolean followedByDigit)
  • Method Details

    • getType

      public int getType()
      Specified by:
      getType in interface ComparableVersion.Item
    • isNull

      public boolean isNull()
      Specified by:
      isNull in interface ComparableVersion.Item
    • comparableQualifier

      public static String comparableQualifier(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 interface ComparableVersion.Item
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object