Class Version

    • Constructor Detail

      • Version

        public Version​(int major,
                       int minor)
        A constructor with a major number and a minor number.

        This constructor is an alias of Version(major, minor, 0).

        Parameters:
        major - A major number.
        minor - A minor number.
      • Version

        public Version​(int major,
                       int minor,
                       int patch)
        A constructor with a major number, a minor number and a patch number.
        Parameters:
        major - A major number.
        minor - A minor number.
        patch - A patch number.
    • Method Detail

      • getMajor

        public int getMajor()
        Get the major number.
        Returns:
        The major number.
      • getMinor

        public int getMinor()
        Get the minor number.
        Returns:
        The minor number.
      • getPatch

        public int getPatch()
        Get the patch number.
        Returns:
        The patch number.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • greaterThan

        public boolean greaterThan​(Version other)
        Judge whether this version is greater than the given version.
        Parameters:
        other - A version to compare to.
        Returns:
        true if this version is greater than the given version.
      • greaterThanOrEqualTo

        public boolean greaterThanOrEqualTo​(Version other)
        Judge whether this version is greater than or equal to the given version.
        Parameters:
        other - A version to compare to.
        Returns:
        true if this version is greater than or equal to the given version.
      • lessThan

        public boolean lessThan​(Version other)
        Judge whether this version is less than the given version.
        Parameters:
        other - A version to compare to.
        Returns:
        true if this version is less than the given version.
      • lessThanOrEqualTo

        public boolean lessThanOrEqualTo​(Version other)
        Judge whether this version is less than or equal to the given version.
        Parameters:
        other - A version to compare to.
        Returns:
        true if this version is less than or equal to the given version.