Package com.lucimber.dbus.codec.decoder
Class DictDecoder<KeyT extends DBusBasicType,ValueT extends DBusType>
java.lang.Object
com.lucimber.dbus.codec.decoder.DictDecoder<KeyT,ValueT>
- Type Parameters:
KeyT
- The data type of the key.ValueT
- The data type of the value.
- All Implemented Interfaces:
Decoder<ByteBuffer,
DBusDict<KeyT, ValueT>>
public final class DictDecoder<KeyT extends DBusBasicType,ValueT extends DBusType>
extends Object
implements Decoder<ByteBuffer,DBusDict<KeyT,ValueT>>
A decoder which unmarshals a dictionary from the byte stream format used by D-Bus.
-
Constructor Summary
ConstructorsConstructorDescriptionDictDecoder
(DBusSignature signature) Creates a new decoder for D-Bus dictionary types. -
Method Summary
Modifier and TypeMethodDescriptiondecode
(ByteBuffer buffer, int offset) Decodes a specific type from a buffer.
-
Constructor Details
-
DictDecoder
Creates a new decoder for D-Bus dictionary types.- Parameters:
signature
- the dictionary signature to decode- Throws:
IllegalArgumentException
- if signature is not a dictionary
-
-
Method Details
-
decode
public DecoderResult<DBusDict<KeyT,ValueT>> decode(ByteBuffer buffer, int offset) throws DecoderException Description copied from interface:Decoder
Decodes a specific type from a buffer.- Specified by:
decode
in interfaceDecoder<KeyT extends DBusBasicType,
ValueT extends DBusType> - Parameters:
buffer
- The buffer that contains the marshalled type.offset
- The number of bytes of a message, that have already been decoded.- Returns:
- The result of the decoding procedure.
- Throws:
DecoderException
- If the value could not be decoded successfully.
-