public abstract class KlvDataElement<T> extends Object
Modifier and Type | Field and Description |
---|---|
protected String |
key |
protected byte[] |
keyBytes |
protected String |
name |
protected T |
value |
Constructor and Description |
---|
KlvDataElement(byte[] key,
String name)
Constructs a
KlvDataElement that describes how to interpret the value of a data element
with the given key. |
Modifier and Type | Method and Description |
---|---|
protected abstract KlvDataElement |
copy() |
protected abstract void |
decodeValue(Klv klv) |
byte[] |
getKey() |
protected String |
getKeyAsString() |
String |
getName() |
T |
getValue() |
boolean |
isErrorIndicated()
If the data element was encoded with an error indicator value and the value matches that
indicator, then this method will return
true . |
protected final byte[] keyBytes
protected final String key
protected final String name
protected T value
public KlvDataElement(byte[] key, String name)
KlvDataElement
that describes how to interpret the value of a data element
with the given key.key
- the data element's keyname
- a name describing the data element's valueIllegalArgumentException
- if any arguments are nullpublic final byte[] getKey()
protected final String getKeyAsString()
public final String getName()
protected abstract void decodeValue(Klv klv)
public T getValue()
protected abstract KlvDataElement copy()
public boolean isErrorIndicated()
true
. Child classes should override the default
implementation if they support error indicator values.This work is licensed under a Creative Commons Attribution 4.0 International License.