Class Version

java.lang.Object
org.jivesoftware.util.Version
All Implemented Interfaces:
Comparable<Version>

public final class Version extends Object implements Comparable<Version>
Holds version information for Openfire.
Author:
Iain Shigeoka
  • Constructor Details

    • 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 Details

    • 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
    • compareTo

      public int compareTo(Version that)
      Specified by:
      compareTo in interface Comparable<Version>
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

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

      public String toString()
      Overrides:
      toString in class Object
    • ignoringReleaseStatus

      public Version ignoringReleaseStatus()