Package org.jivesoftware.util
Class JavaSpecVersion
java.lang.Object
org.jivesoftware.util.JavaSpecVersion
- All Implemented Interfaces:
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 Summary
ConstructorsConstructorDescriptionJavaSpecVersion
(int major, int minor) Create a new version information object.JavaSpecVersion
(CharSequence source) Create a new version from a simple version string (e.g. -
Method Summary
Modifier and TypeMethodDescriptionint
compareTo
(JavaSpecVersion that) boolean
Returns the version number of this instance of Openfire as a String (ie major.minor.revision).int
hashCode()
boolean
isNewerThan
(JavaSpecVersion otherVersion) Convenience method for comparing versionstoString()
-
Constructor Details
-
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
Create a new version from a simple version string (e.g. "1.8")- 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
-
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<JavaSpecVersion>
-
equals
-
hashCode
public int hashCode() -
toString
-