Package ghidra.util.database

# Class DBCachedObjectStoreFactory.PrimitiveCodec.SimplePrimitiveCodec<T>

java.lang.Object
ghidra.util.database.DBCachedObjectStoreFactory.PrimitiveCodec.AbstractPrimitiveCodec<T>
ghidra.util.database.DBCachedObjectStoreFactory.PrimitiveCodec.SimplePrimitiveCodec<T>

All Implemented Interfaces:
  `DBCachedObjectStoreFactory.PrimitiveCodec<T>`

Enclosing interface:
  `DBCachedObjectStoreFactory.PrimitiveCodec<T>`

public static class DBCachedObjectStoreFactory.PrimitiveCodec.SimplePrimitiveCodec<T> extends DBCachedObjectStoreFactory.PrimitiveCodec.AbstractPrimitiveCodec<T>
A implementation of `DBCachedObjectStoreFactory.PrimitiveCodec` from lambdas or method references

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from interface ghidra.util.database.DBCachedObjectStoreFactory.PrimitiveCodec

  `DBCachedObjectStoreFactory.PrimitiveCodec.AbstractPrimitiveCodec<T>, DBCachedObjectStoreFactory.PrimitiveCodec.ArrayObjectCodec<E>, DBCachedObjectStoreFactory.PrimitiveCodec.ArrayPrimitiveCodec<E,T>, DBCachedObjectStoreFactory.PrimitiveCodec.LengthBoundCodec<T>, DBCachedObjectStoreFactory.PrimitiveCodec.SimplePrimitiveCodec<T>`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected final Function<ByteBuffer,T>`
  `decode`
  `protected final BiConsumer<ByteBuffer,T>`
  `encode`

  ### Fields inherited from class ghidra.util.database.DBCachedObjectStoreFactory.PrimitiveCodec.AbstractPrimitiveCodec

  `selector, valueClass`

  ### Fields inherited from interface ghidra.util.database.DBCachedObjectStoreFactory.PrimitiveCodec

  `ADDRESS, BOOL, BOOL_ARR, BYTE, BYTE_ARR, CHAR, CHAR_ARR, CODECS_BY_CLASS, CODECS_BY_SELECTOR, INT, INT_ARR, LONG, LONG_ARR, RANGE, SHORT, SHORT_ARR, STRING, STRING_ARR`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `SimplePrimitiveCodec(Class<T> valueClass, Function<ByteBuffer,T> decode, BiConsumer<ByteBuffer,T> encode)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `T`
  `decode(ByteBuffer buffer)`
  Decode the value from the given buffer
  `void`
  `encode(ByteBuffer buffer, T value)`
  Encode the value into the given buffer

  ### Methods inherited from class ghidra.util.database.DBCachedObjectStoreFactory.PrimitiveCodec.AbstractPrimitiveCodec

  `getSelector, getValueClass`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### decode

    protected final Function<ByteBuffer,T> decode

  - ### encode

    protected final BiConsumer<ByteBuffer,T> encode

- ## Constructor Details

  - ### SimplePrimitiveCodec

    public SimplePrimitiveCodec(Class<T> valueClass, Function<ByteBuffer,T> decode, BiConsumer<ByteBuffer,T> encode)

- ## Method Details

  - ### decode

    public T decode(ByteBuffer buffer)
    Description copied from interface: `DBCachedObjectStoreFactory.PrimitiveCodec`
    Decode the value from the given buffer
    Parameters:
      `buffer` - the source buffer
    Returns:
      the value

  - ### encode

    public void encode(ByteBuffer buffer, T value)
    Description copied from interface: `DBCachedObjectStoreFactory.PrimitiveCodec`
    Encode the value into the given buffer
    Parameters:
      `buffer` - the destination buffer
      `value` - the value