Interface EnOceanChannelDescription
- All Known Subinterfaces:
EnOceanDataChannelDescription
,EnOceanEnumChannelDescription
,EnOceanFlagChannelDescription
public interface EnOceanChannelDescription
Public and registered description interface for a channel. Encompasses all
the possible subtypes for a channel.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The unique ID of this EnOceanChannelDescription object.static final String
A DATA channel maps itself to aDouble
value representing a physical measure.static final String
An ENUM channel maps itself to one between a list of discreteEnOceanChannelEnumValue
"value objects".static final String
A FLAG channel maps itself to aBoolean
value.static final String
A RAW channel is only made of bytes. -
Method Summary
Modifier and TypeMethodDescriptiondeserialize
(byte[] bytes) Tries to deserialize a series of bytes into a documented value object (raw bytes, Double orEnOceanChannelEnumValue
.getType()
Retrieves the type of the channel.byte[]
Tries to serialize the channel into a series of bytes.
-
Field Details
-
CHANNEL_ID
The unique ID of this EnOceanChannelDescription object.- See Also:
-
TYPE_RAW
A RAW channel is only made of bytes.- See Also:
-
TYPE_DATA
A DATA channel maps itself to aDouble
value representing a physical measure.- See Also:
-
TYPE_FLAG
A FLAG channel maps itself to aBoolean
value.- See Also:
-
TYPE_ENUM
An ENUM channel maps itself to one between a list of discreteEnOceanChannelEnumValue
"value objects".- See Also:
-
-
Method Details
-
getType
String getType()Retrieves the type of the channel.- Returns:
- one of the above-described types.
-
serialize
Tries to serialize the channel into a series of bytes.- Parameters:
obj
- the value of the channel.- Returns:
- the right-aligned value, in raw bytes, of the channel.
- Throws:
IllegalArgumentException
-
deserialize
Tries to deserialize a series of bytes into a documented value object (raw bytes, Double orEnOceanChannelEnumValue
. Of course this method will be specialized for eachEnOceanChannelDescription
subinterface, depending on the type of this channel.- Parameters:
bytes
- the right-aligned raw bytes.- Returns:
- a value object.
- Throws:
IllegalArgumentException
-