Class MapCodec<K,V>

java.lang.Object
com.illumon.util.codec.MapCodec<K,V>
All Implemented Interfaces:
ObjectCodec<Map<K,V>>, io.deephaven.util.codec.ObjectCodec<Map<K,V>>, io.deephaven.util.codec.ObjectDecoder<Map<K,V>>
Direct Known Subclasses:
StringBooleanMapCodec

public abstract class MapCodec<K,V> extends Object implements ObjectCodec<Map<K,V>>
ObjectCodec implementation for Maps of type K to V. Each map is encoded as an integer length, followed by encoded pairs of key values. A null map is represented as an array of zero bytes.
  • Method Details

    • isNullable

      public boolean isNullable()
      Specified by:
      isNullable in interface io.deephaven.util.codec.ObjectCodec<K>
    • getPrecision

      public int getPrecision()
      Specified by:
      getPrecision in interface io.deephaven.util.codec.ObjectCodec<K>
    • getScale

      public int getScale()
      Specified by:
      getScale in interface io.deephaven.util.codec.ObjectCodec<K>
    • encode

      @NotNull public @org.jetbrains.annotations.NotNull byte[] encode(@Nullable @Nullable Map<K,V> input)
      Specified by:
      encode in interface io.deephaven.util.codec.ObjectCodec<K>
    • decode

      @Nullable public @Nullable Map<K,V> decode(@NotNull @org.jetbrains.annotations.NotNull byte[] input, int offset, int length)
      Specified by:
      decode in interface io.deephaven.util.codec.ObjectDecoder<K>
    • decode

      @Nullable public @Nullable Map<K,V> decode(ByteBuffer byteBuffer)
      Specified by:
      decode in interface io.deephaven.util.codec.ObjectDecoder<K>
    • expectedObjectWidth

      public int expectedObjectWidth()
      Specified by:
      expectedObjectWidth in interface io.deephaven.util.codec.ObjectDecoder<K>