Class ComparableVersion.StringItem

    • 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
    • Constructor Detail

      • StringItem

        StringItem​(java.lang.String value,
                   boolean followedByDigit)
    • Method Detail

      • 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
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

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

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object