Package org.jivesoftware.util
Class Version
java.lang.Object
org.jivesoftware.util.Version
- All Implemented Interfaces:
Comparable<Version>
Holds version information for Openfire.
- Author:
- Iain Shigeoka
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
A class to represent the release status of the server. -
Constructor Summary
ConstructorsConstructorDescriptionVersion
(int major, int minor, int micro, Version.ReleaseStatus status, int statusVersion) Create a new version information object.Version
(CharSequence source) Create a new version from a simple version string (e.g. -
Method Summary
Modifier and TypeMethodDescriptionint
boolean
int
getMajor()
Obtain the major release number for this product.int
getMicro()
Obtain the micro release number for this product.int
getMinor()
Obtain the minor release number for this product.Returns the release status of this product.int
Obtain the status release number for this product.Returns the version number of this instance of Openfire as a String (ie major.minor.revision).int
hashCode()
boolean
isNewerThan
(Version otherVersion) Convenience method for comparing versionstoString()
-
Constructor Details
-
Version
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
Create a new version from a simple version string (e.g. "3.9.3")- Parameters:
source
- the version string
-
-
Method Details
-
getVersionString
Returns the version number of this instance of Openfire as a String (ie major.minor.revision).- Returns:
- The version as a string
-
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
Convenience method for comparing versions- Parameters:
otherVersion
- a version to compare against- Returns:
true
if this version is newer, otherwisefalse
-
compareTo
- Specified by:
compareTo
in interfaceComparable<Version>
-
equals
-
hashCode
public int hashCode() -
toString
-
ignoringReleaseStatus
-