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

      • parse

        public static JavaVersion parse​(String s)
        Lazy parse the version-scheme. Actual parsing is done when calling compareTo(JavaVersion)
        Parameters:
        s - the version string, never null
        Returns:
        the version wrapped in a JavadocVersion
      • 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​(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​(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
      • asMajor

        public JavaVersion asMajor()
        If original version starts with "1.", then remove this part from the version
        Returns:
        a new JavaVersion if version has to be changed, otherwise return itself
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object