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.- Version:
- 1.0
- Author:
- $Id: 61b21375118e33bd04c3ede4f4d8374e927ce076 $
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
CHANNEL_ID
The unique ID of this EnOceanChannelDescription object.static java.lang.String
TYPE_DATA
A DATA channel maps itself to aDouble
value representing a physical measure.static java.lang.String
TYPE_ENUM
An ENUM channel maps itself to one between a list of discreteEnOceanChannelEnumValue
"value objects".static java.lang.String
TYPE_FLAG
A FLAG channel maps itself to aBoolean
value.static java.lang.String
TYPE_RAW
A RAW channel is only made of bytes.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.Object
deserialize(byte[] bytes)
Tries to deserialize a series of bytes into a documented value object (raw bytes, Double orEnOceanChannelEnumValue
.java.lang.String
getType()
Retrieves the type of the channel.byte[]
serialize(java.lang.Object obj)
Tries to serialize the channel into a series of bytes.
-
-
-
Field Detail
-
CHANNEL_ID
static final java.lang.String CHANNEL_ID
The unique ID of this EnOceanChannelDescription object.- See Also:
- Constant Field Values
-
TYPE_RAW
static final java.lang.String TYPE_RAW
A RAW channel is only made of bytes.- See Also:
- Constant Field Values
-
TYPE_DATA
static final java.lang.String TYPE_DATA
A DATA channel maps itself to aDouble
value representing a physical measure.- See Also:
- Constant Field Values
-
TYPE_FLAG
static final java.lang.String TYPE_FLAG
A FLAG channel maps itself to aBoolean
value.- See Also:
- Constant Field Values
-
TYPE_ENUM
static final java.lang.String TYPE_ENUM
An ENUM channel maps itself to one between a list of discreteEnOceanChannelEnumValue
"value objects".- See Also:
- Constant Field Values
-
-
Method Detail
-
getType
java.lang.String getType()
Retrieves the type of the channel.- Returns:
- one of the above-described types.
-
serialize
byte[] serialize(java.lang.Object obj)
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:
java.lang.IllegalArgumentException
-
deserialize
java.lang.Object deserialize(byte[] bytes)
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:
java.lang.IllegalArgumentException
-
-