Package com.lucimber.dbus.codec.decoder
Class DictEntryDecoder<KeyT extends DBusBasicType,ValueT extends DBusType>
java.lang.Object
com.lucimber.dbus.codec.decoder.DictEntryDecoder<KeyT,ValueT>
- Type Parameters:
KeyT
- The data type of the key.ValueT
- The data type of the value.
- All Implemented Interfaces:
Decoder<ByteBuffer,
DBusDictEntry<KeyT, ValueT>>
public final class DictEntryDecoder<KeyT extends DBusBasicType,ValueT extends DBusType>
extends Object
implements Decoder<ByteBuffer,DBusDictEntry<KeyT,ValueT>>
A decoder which unmarshals a key-value pair from the byte stream format used by D-Bus.
-
Constructor Summary
ConstructorsConstructorDescriptionDictEntryDecoder
(DBusSignature signature) Creates a new instance with mandatory parameters. -
Method Summary
Modifier and TypeMethodDescriptiondecode
(ByteBuffer buffer, int offset) Decodes a specific type from a buffer.
-
Constructor Details
-
DictEntryDecoder
Creates a new instance with mandatory parameters.- Parameters:
signature
- the signature of the dict-entry
-
-
Method Details
-
decode
public DecoderResult<DBusDictEntry<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.
-