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 AttrVersionDefault value if none is provided.private final intMajor portion of the version.private final intMinor portion of the version. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint(package private) static AttrVersioncreateFromString(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 AttrVersionGet 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
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
- Specified by:
compareToin interfaceComparable- Overrides:
compareToin classAbstractAttr<String>- Parameters:
otherObj- object to compare to- Returns:
- -1, 0, or 1
-