Class GenericVersion

  • All Implemented Interfaces:
    java.lang.Comparable<Version>, Version

    final class GenericVersion
    extends java.lang.Object
    implements Version
    A generic version, that is a version that accepts any input string and tries to apply common sense sorting. See GenericVersionScheme for details.
    • Field Detail

      • version

        private final java.lang.String version
      • hash

        private final int hash
    • Constructor Detail

      • GenericVersion

        GenericVersion​(java.lang.String version)
        Creates a generic version from the specified string.
        Parameters:
        version - The version string, must not be null.
    • Method Detail

      • compareTo

        public int compareTo​(Version obj)
        Specified by:
        compareTo in interface java.lang.Comparable<Version>
      • comparePadding

        private static int comparePadding​(GenericVersion.Item[] items,
                                          int index,
                                          java.lang.Boolean number)
      • equals

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

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

        public java.lang.String toString()
        Description copied from interface: Version
        Gets the original string representation of the version.
        Specified by:
        toString in interface Version
        Overrides:
        toString in class java.lang.Object
        Returns:
        The string representation of the version, never null.