Package org.igniterealtime.jbosh
Class AttrVersion
- All Implemented Interfaces:
Comparable
Data type representing the getValue of the
ver
attribute of the
bosh
element.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final AttrVersion
Default value if none is provided.private final int
Major portion of the version.private final int
Minor portion of the version. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
(package private) static AttrVersion
createFromString
(String str) Creates a new attribute instance from the provided String.(package private) int
getMajor()
Returns the 'major' portion of the version number.(package private) int
getMinor()
Returns the 'minor' portion of the version number.(package private) static AttrVersion
Get the version of specifcation that we support.Methods inherited from class org.igniterealtime.jbosh.AbstractAttr
equals, getValue, hashCode, toString
-
Field Details
-
DEFAULT
Default value if none is provided. -
major
private final int majorMajor portion of the version. -
minor
private final int minorMinor portion of the version.
-
-
Constructor Details
-
AttrVersion
Creates a new attribute object.- Parameters:
val
- attribute getValue- Throws:
BOSHException
- on parse or validation failure
-
-
Method Details
-
getSupportedVersion
Get the version of specifcation that we support.- Returns:
- max spec version the code supports
-
createFromString
Creates a new attribute instance from the provided String.- Parameters:
str
- string representation of the attribute- Returns:
- attribute instance or
null
if provided string isnull
- Throws:
BOSHException
- on parse or validation failure
-
getMajor
int getMajor()Returns the 'major' portion of the version number.- Returns:
- major digits only
-
getMinor
int getMinor()Returns the 'minor' portion of the version number.- Returns:
- minor digits only
-
compareTo
- Specified by:
compareTo
in interfaceComparable
- Overrides:
compareTo
in classAbstractAttr<String>
- Parameters:
otherObj
- object to compare to- Returns:
- -1, 0, or 1
-