Class Version

    • Field Detail

      • ZERO

        public static final Version ZERO
      • MIN

        public static final Version MIN
      • MAX

        public static final Version MAX
    • Constructor Detail

      • Version

        public Version​(int major,
                       int minor,
                       int update)
        Creates a new version object given the major, minor and update version numbers.
        Parameters:
        major - the major version
        minor - the minor version
        update - the update version
    • Method Detail

      • parseString

        public static Version parseString​(String version)
        Creates a new version object given a string representation of the version.
        Parameters:
        version - the version string
        Returns:
        the version object
        Throws:
        NumberFormatException - if the version string is invalid
      • isGreaterThan

        public boolean isGreaterThan​(Version version)
        Tests if the current version is greater than the given one.
        Parameters:
        version - the version to compare to the current one
        Returns:
        true if the current version is greater, false otherwise
      • isGreaterOrEqualThan

        public boolean isGreaterOrEqualThan​(Version version)
        Tests if the current version is greater or equal to the given one.
        Parameters:
        version - the version to compare to the current one
        Returns:
        if the current version is greater or equal, false otherwise
      • isEqualTo

        public boolean isEqualTo​(Version version)
        Tests if the current version is equal to the given one.
        Parameters:
        version - the version to compare to the current one
        Returns:
        if the current version is equal to the given one, false otherwise
      • getMinorVersion

        public int getMinorVersion()
        Gets the minor version field.
        Returns:
        the minor
      • getMajorVersion

        public int getMajorVersion()
        Gets the major version field.
        Returns:
        the major
      • getUpdateVersion

        public int getUpdateVersion()
        Gets the update version field.
        Returns:
        the update
      • toString

        public String toString()
        Gets the string representation of this version.

        The string representation can be used in parseString(String) to create a version object.

        Overrides:
        toString in class Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object