Package org.codice.ddf.libs.klv
Class KlvDataElement<T>
java.lang.Object
org.codice.ddf.libs.klv.KlvDataElement<T>
- Direct Known Subclasses:
KlvBytes,KlvEncodingDetectedString,KlvLocalSet,KlvNumericalDataElement,KlvString
Describes how to interpret the value of a certain data element.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionKlvDataElement(byte[] key, String name) Constructs aKlvDataElementthat describes how to interpret the value of a data element with the given key. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract KlvDataElementcopy()protected abstract voiddecodeValue(Klv klv) final byte[]getKey()protected final Stringfinal StringgetName()getValue()booleanIf the data element was encoded with an error indicator value and the value matches that indicator, then this method will returntrue.
-
Field Details
-
keyBytes
protected final byte[] keyBytes -
key
-
name
-
value
-
-
Constructor Details
-
KlvDataElement
Constructs aKlvDataElementthat describes how to interpret the value of a data element with the given key.- Parameters:
key- the data element's keyname- a name describing the data element's value- Throws:
IllegalArgumentException- if any arguments are null
-
-
Method Details
-
getKey
public final byte[] getKey() -
getKeyAsString
-
getName
-
decodeValue
-
getValue
-
copy
-
isErrorIndicated
public boolean isErrorIndicated()If the data element was encoded with an error indicator value and the value matches that indicator, then this method will returntrue. Child classes should override the default implementation if they support error indicator values.- Returns:
- true if error was encoded
-