Class KlvDataElement<T>

java.lang.Object
org.codice.ddf.libs.klv.KlvDataElement<T>
Direct Known Subclasses:
KlvBytes, KlvEncodingDetectedString, KlvLocalSet, KlvNumericalDataElement, KlvString

public abstract class KlvDataElement<T> extends Object
Describes how to interpret the value of a certain data element.
  • Field Details

    • keyBytes

      protected final byte[] keyBytes
    • key

      protected final String key
    • name

      protected final String name
    • value

      protected T value
  • Constructor Details

    • KlvDataElement

      public KlvDataElement(byte[] key, String name)
      Constructs a KlvDataElement that describes how to interpret the value of a data element with the given key.
      Parameters:
      key - the data element's key
      name - a name describing the data element's value
      Throws:
      IllegalArgumentException - if any arguments are null
  • Method Details

    • getKey

      public final byte[] getKey()
    • getKeyAsString

      protected final String getKeyAsString()
    • getName

      public final String getName()
    • decodeValue

      protected abstract void decodeValue(Klv klv)
    • getValue

      public T getValue()
    • copy

      protected abstract KlvDataElement 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 return true. Child classes should override the default implementation if they support error indicator values.
      Returns:
      true if error was encoded