Package com.lucimber.dbus.codec.decoder
Class DecoderResultImpl<ValueT extends DBusType>
java.lang.Object
com.lucimber.dbus.codec.decoder.DecoderResultImpl<ValueT>
- Type Parameters:
ValueT
- The value's data type.
- All Implemented Interfaces:
DecoderResult<ValueT>
public final class DecoderResultImpl<ValueT extends DBusType>
extends Object
implements DecoderResult<ValueT>
Default implementation of the decoder result interface.
-
Constructor Summary
ConstructorsConstructorDescriptionDecoderResultImpl
(int consumedBytes, ValueT value) Constructs a new decoder result. -
Method Summary
Modifier and TypeMethodDescriptionint
Gets the number of bytes, that have been consumed by a decoder while producing this result.getValue()
Gets the decoded value.void
setConsumedBytes
(int consumedBytes) Sets the number of bytes, that have been consumed by a decoder while producing this result.
-
Constructor Details
-
DecoderResultImpl
Constructs a new decoder result.- Parameters:
consumedBytes
- number of consumed bytesvalue
- the decoded value
-
-
Method Details
-
getConsumedBytes
public int getConsumedBytes()Description copied from interface:DecoderResult
Gets the number of bytes, that have been consumed by a decoder while producing this result.- Specified by:
getConsumedBytes
in interfaceDecoderResult<ValueT extends DBusType>
- Returns:
- An integer as the number of consumed bytes.
-
setConsumedBytes
public void setConsumedBytes(int consumedBytes) Description copied from interface:DecoderResult
Sets the number of bytes, that have been consumed by a decoder while producing this result.- Specified by:
setConsumedBytes
in interfaceDecoderResult<ValueT extends DBusType>
- Parameters:
consumedBytes
- anInteger
-
getValue
Description copied from interface:DecoderResult
Gets the decoded value.- Specified by:
getValue
in interfaceDecoderResult<ValueT extends DBusType>
- Returns:
- the value.
-