Package org.osgi.service.zigbee.types
Class ZigBeeUnsignedInteger24
java.lang.Object
org.osgi.service.zigbee.types.ZigBeeUnsignedInteger24
- All Implemented Interfaces:
ZCLDataTypeDescription
,ZCLSimpleTypeDescription
A singleton class that represents the 'Unsigned Integer 24-bit' data type,
as it is defined in the ZigBee Cluster Library specification.
-
Method Summary
Modifier and TypeMethodDescriptionDeserializes a value from the passedZigBeeDataInput
stream.short
getId()
Returns the data type identifier.static ZigBeeUnsignedInteger24
Gets a singleton instance of this class.Class<?>
Returns the corresponding Java type class.getName()
Returns the associated data type name.boolean
isAnalog()
Checks if the data type is analog.void
serialize
(ZigBeeDataOutput os, Object value) Serializes a ZigBee data type into aZigBeeDataOutput
stream.
-
Method Details
-
getInstance
Gets a singleton instance of this class.- Returns:
- the singleton instance.
-
getName
Description copied from interface:ZCLDataTypeDescription
Returns the associated data type name.- Specified by:
getName
in interfaceZCLDataTypeDescription
- Returns:
- the associated data type name string.
-
isAnalog
public boolean isAnalog()Description copied from interface:ZCLDataTypeDescription
Checks if the data type is analog.- Specified by:
isAnalog
in interfaceZCLDataTypeDescription
- Returns:
- true, if the data type is Analog, otherwise is Discrete.
-
getJavaDataType
Description copied from interface:ZCLDataTypeDescription
Returns the corresponding Java type class.- Specified by:
getJavaDataType
in interfaceZCLDataTypeDescription
- Returns:
- the corresponding Java type class.
-
getId
public short getId()Description copied from interface:ZCLDataTypeDescription
Returns the data type identifier.- Specified by:
getId
in interfaceZCLDataTypeDescription
- Returns:
- the data type identifier. The data types identifiers supported by
this specification are defined in the
ZigBeeDataTypes
interface.
-
serialize
Description copied from interface:ZCLSimpleTypeDescription
Serializes a ZigBee data type into aZigBeeDataOutput
stream. An implementation of this method must throw anIllegalArgumentException
if the passed value does not belong to the expected class or its value exceeds the possible values allowed (in terms of range or length).An implementation of this method must interpret (where it makes sense) a
null
value as the request to serialize the so called Invalid Value.- Specified by:
serialize
in interfaceZCLSimpleTypeDescription
- Parameters:
os
- aZigBeeDataOutput
stream where to the passed value will be appended. This parameter cannot benull
. Ifnull
aNullPointerException
must be thrown.value
- The value that have to be serialized on the output stream. If null is passed this method outputs on the stream the ZigBee invalid value related the specific data type. If the data type do not allow any invalid value and the passed value is null anIllegalArgumentException
is thrown.- Throws:
IOException
- If an I/O error occurs while writing on theZigBeeDataOutput
. TheEOFException
may be thrown if there is no more space on the data output for serializing the passed value.
-
deserialize
Description copied from interface:ZCLSimpleTypeDescription
Deserializes a value from the passedZigBeeDataInput
stream.- Specified by:
deserialize
in interfaceZCLSimpleTypeDescription
- Parameters:
is
- theZigBeeDataInput
from where the value of data type is read from.- Returns:
- An object that represents the deserialized value of data. Returns
null
if the read value represents the Invalid Value for the specific ZigBee data type. - Throws:
IOException
- If an I/O error occurs while reading theZigBeeDataInput
. AnEOFException
is thrown if the data input stream end is reached while deserializing the data type.
-