Class Version

    • Field Detail

      • ALPHA_VERSION

        public static final Version ALPHA_VERSION
        Represents an alpha version of a plugin.
      • BETA_VERSION

        public static final Version BETA_VERSION
        Represents a beta version of a plugin.
      • BUILD_VERSION

        public static final Version BUILD_VERSION
        Represents a build version of a plugin.
      • DEFAULT_VERSION

        public static final Version DEFAULT_VERSION
        Represents a default release version of a plugin.
    • Constructor Detail

      • Version

        public Version​(int major,
                       int minor,
                       int revision,
                       String build)
        Constructs a new version with the specified version numbers and build.
        Parameters:
        major - the major version number
        minor - the minor version number
        revision - the revision version number
        build - the build version
      • Version

        public Version​(int major,
                       int minor,
                       int revision)
        Constructs a new version with the specified version numbers.
        Parameters:
        major - the major version number
        minor - the minor version number
        revision - the revision version number
      • Version

        public Version​(int major,
                       int minor)
        Constructs a new version with the specified version numbers.
        Parameters:
        major - the major version number
        minor - the minor version number
      • Version

        public Version​(@NotNull
                       String version)
        Constructs a new version with the specified version.
        Parameters:
        version - the version to be parsed.
    • Method Detail

      • getMajor

        public int getMajor()
      • getMinor

        public int getMinor()
      • getRevision

        public int getRevision()
      • getBuild

        public String getBuild()
      • higher

        public boolean higher​(@NonNull Version version)
        Indicate whether this version is greater than the specified version

        Note: This method is equivalent to this.compareTo(version) > 0. this method return true also indicate lower(Version) and equals(Object) return false.

        Parameters:
        version - the version to compare to
        Returns:
        true if this version is greater than the specified version, false otherwise
        See Also:
        lower(Version), equals(Object), compareTo(Version)
      • lower

        public boolean lower​(@NonNull Version version)
        Indicate whether this version is lower than the specified version

        Note: This method is equivalent to version.higher(this). this method return true also indicate higher(Version) (Version)} and equals(Object) return false.

        Parameters:
        version - the version to compare to
        Returns:
        true if this version is lower than the specified version, false otherwise
        See Also:
        higher(Version), equals(Object), compareTo(Version)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object