Class JavaVersion

    • Field Detail

      • JAVA_SPECIFICATION_VERSION

        public static final JavaVersion JAVA_SPECIFICATION_VERSION
        Represents the System property java.specification.version
      • JAVA_VERSION

        public static final JavaVersion JAVA_VERSION
        Represents the System property java.version
      • startingDigits

        private static final java.util.regex.Pattern startingDigits
      • rawVersion

        private java.lang.String rawVersion
    • Constructor Detail

      • JavaVersion

        private JavaVersion​(java.lang.String rawVersion)
    • Method Detail

      • parse

        public static JavaVersion parse​(java.lang.String s)
        Lazy parse the version-scheme. Actual parsing is done when calling compareTo(JavaVersion)
        Parameters:
        s - the version string
        Returns:
        the version wrapped in a JavadocVersion
      • compareTo

        public int compareTo​(JavaVersion other)
        Specified by:
        compareTo in interface java.lang.Comparable<JavaVersion>
      • suffixRate

        private int suffixRate​(java.lang.String suffix)
      • isBefore

        public boolean isBefore​(JavaVersion other)
        Verify if this version is before some other version
        Parameters:
        other - the version to compare with
        Returns:
        true is this is less than other, otherwise false
      • isBefore

        public boolean isBefore​(java.lang.String other)
        Verify if this version is before some other version
        Parameters:
        other - the version to compare with
        Returns:
        true is this is less than other, otherwise false
      • isAtLeast

        public boolean isAtLeast​(JavaVersion other)
        Verify if this version is at least some other version
        Parameters:
        other - the version to compare with
        Returns:
        true is this is greater than or equal to other, otherwise false
      • isAtLeast

        public boolean isAtLeast​(java.lang.String other)
        Verify if this version is at least some other version
        Parameters:
        other - the version to compare with
        Returns:
        true is this is greater than or equal to other, otherwise false
      • toString

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

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

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