Class Version

    • Constructor Detail

      • Version

        public Version​(int major,
                       int minor,
                       int micro,
                       Version.ReleaseStatus status,
                       int statusVersion)
        Create a new version information object.
        Parameters:
        major - the major release number.
        minor - the minor release number.
        micro - the micro release number.
        status - the status of the release.
        statusVersion - status release number or -1 to indicate none.
      • Version

        public Version​(CharSequence source)
        Create a new version from a simple version string (e.g. "3.9.3")
        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
      • getStatus

        public Version.ReleaseStatus getStatus()
        Returns the release status of this product.
        Returns:
        the release status of this product.
      • getMajor

        public int getMajor()
        Obtain the major release number for this product.
        Returns:
        The major release number 1.x.x
      • getMinor

        public int getMinor()
        Obtain the minor release number for this product.
        Returns:
        The minor release number x.1.x
      • getMicro

        public int getMicro()
        Obtain the micro release number for this product.
        Returns:
        The micro release number x.x.1
      • getStatusVersion

        public int getStatusVersion()
        Obtain the status release number for this product. For example, if the release status is alpha the release may be 5 resulting in a release status of Alpha 5.
        Returns:
        The status version or -1 if none is set.
      • isNewerThan

        public boolean isNewerThan​(Version 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
      • ignoringReleaseStatus

        public Version ignoringReleaseStatus()