Package org.igniterealtime.jbosh
Class AttrVersion
- java.lang.Object
-
- org.igniterealtime.jbosh.AbstractAttr<java.lang.String>
-
- org.igniterealtime.jbosh.AttrVersion
-
- All Implemented Interfaces:
java.lang.Comparable
final class AttrVersion extends AbstractAttr<java.lang.String> implements java.lang.Comparable
Data type representing the getValue of theverattribute of theboshelement.
-
-
Field Summary
Fields Modifier and Type Field Description private static AttrVersionDEFAULTDefault value if none is provided.private intmajorMajor portion of the version.private intminorMinor portion of the version.
-
Constructor Summary
Constructors Modifier Constructor Description privateAttrVersion(java.lang.String val)Creates a new attribute object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(java.lang.Object otherObj)(package private) static AttrVersioncreateFromString(java.lang.String str)Creates a new attribute instance from the provided String.(package private) intgetMajor()Returns the 'major' portion of the version number.(package private) intgetMinor()Returns the 'minor' portion of the version number.(package private) static AttrVersiongetSupportedVersion()Get the version of specifcation that we support.-
Methods inherited from class org.igniterealtime.jbosh.AbstractAttr
equals, getValue, hashCode, toString
-
-
-
-
Field Detail
-
DEFAULT
private static final AttrVersion DEFAULT
Default value if none is provided.
-
major
private final int major
Major portion of the version.
-
minor
private final int minor
Minor portion of the version.
-
-
Constructor Detail
-
AttrVersion
private AttrVersion(java.lang.String val) throws BOSHExceptionCreates a new attribute object.- Parameters:
val- attribute getValue- Throws:
BOSHException- on parse or validation failure
-
-
Method Detail
-
getSupportedVersion
static AttrVersion getSupportedVersion()
Get the version of specifcation that we support.- Returns:
- max spec version the code supports
-
createFromString
static AttrVersion createFromString(java.lang.String str) throws BOSHException
Creates a new attribute instance from the provided String.- Parameters:
str- string representation of the attribute- Returns:
- attribute instance or
nullif 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
public int compareTo(java.lang.Object otherObj)
- Specified by:
compareToin interfacejava.lang.Comparable- Overrides:
compareToin classAbstractAttr<java.lang.String>- Parameters:
otherObj- object to compare to- Returns:
- -1, 0, or 1
-
-