Class JavaSpecVersion

  • All Implemented Interfaces:
    Comparable<JavaSpecVersion>

    public final class JavaSpecVersion
    extends Object
    implements Comparable<JavaSpecVersion>
    Holds version information for Java specification (a major and minor version, eg: 1.8, or just a number, eg: 11). For comparison purposes, only the minor version number is used.
    Author:
    Guus der Kinderen, guus.der.kinderen@gmail.com
    • Constructor Detail

      • JavaSpecVersion

        public JavaSpecVersion​(int major,
                               int minor)
        Create a new version information object.
        Parameters:
        major - the major release number.
        minor - the minor release number.
      • JavaSpecVersion

        public JavaSpecVersion​(CharSequence source)
        Create a new version from a simple version string (e.g. "1.8")
        Parameters:
        source - the version string
    • Method Detail

      • getVersionString

        public String getVersionString()
        Returns the version number of this instance of Openfire as a String (ie major.minor.revision).
        Returns:
        The version as a string
      • isNewerThan

        public boolean isNewerThan​(JavaSpecVersion otherVersion)
        Convenience method for comparing versions
        Parameters:
        otherVersion - a version to compare against
        Returns:
        true if this version is newer, otherwise false
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object