Package ghidra.util.database
Interface DBCachedObjectStoreFactory.PrimitiveCodec<T>
- Type Parameters:
T- the type of values encoded
- All Known Implementing Classes:
DBCachedObjectStoreFactory.PrimitiveCodec.AbstractPrimitiveCodec,DBCachedObjectStoreFactory.PrimitiveCodec.ArrayObjectCodec,DBCachedObjectStoreFactory.PrimitiveCodec.ArrayPrimitiveCodec,DBCachedObjectStoreFactory.PrimitiveCodec.LengthBoundCodec,DBCachedObjectStoreFactory.PrimitiveCodec.SimplePrimitiveCodec
- Enclosing class:
DBCachedObjectStoreFactory
public static interface DBCachedObjectStoreFactory.PrimitiveCodec<T>
Codec for a primitive type
This is used by DBCachedObjectStoreFactory.VariantDBFieldCodec to encode primitive values. Sadly, the existing
primitive field codecs cannot be used, since they write to fields directly. All these encode
into byte buffers, since the variant codec uses BinaryField.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classAn abstract implementation ofDBCachedObjectStoreFactory.PrimitiveCodecstatic classAn implementation of an array codec, using its element codec, where elements are objectsstatic classAn implementation of an array codec, using its element codec, where elements can be primitivesstatic classA codec which encodes length-value, using the (unbounded) codec for valuestatic classA implementation ofDBCachedObjectStoreFactory.PrimitiveCodecfrom lambdas or method references -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final DBCachedObjectStoreFactory.PrimitiveCodec<Boolean> Codec forbooleanstatic final DBCachedObjectStoreFactory.PrimitiveCodec<boolean[]> Codec forboolean[]static final DBCachedObjectStoreFactory.PrimitiveCodec<Byte> Codec forbytestatic final DBCachedObjectStoreFactory.PrimitiveCodec<byte[]> Codec forbyte[]static final DBCachedObjectStoreFactory.PrimitiveCodec<Character> Codec forcharstatic final DBCachedObjectStoreFactory.PrimitiveCodec<char[]> Codec forchar[]static final Map<Class<?>, DBCachedObjectStoreFactory.PrimitiveCodec<?>> static final Map<Byte, DBCachedObjectStoreFactory.PrimitiveCodec<?>> static final DBCachedObjectStoreFactory.PrimitiveCodec<Integer> Codec forintstatic final DBCachedObjectStoreFactory.PrimitiveCodec<int[]> Codec forint[]static final DBCachedObjectStoreFactory.PrimitiveCodec<Long> Codec forlongstatic final DBCachedObjectStoreFactory.PrimitiveCodec<long[]> Codec forlong[]static final DBCachedObjectStoreFactory.PrimitiveCodec<Short> Codec forshortstatic final DBCachedObjectStoreFactory.PrimitiveCodec<short[]> Codec forshort[]static final DBCachedObjectStoreFactory.PrimitiveCodec<String> Codec forStringstatic final DBCachedObjectStoreFactory.PrimitiveCodec<String[]> Codec forString[] -
Method Summary
Modifier and TypeMethodDescriptiondecode(ByteBuffer buffer) Decode the value from the given buffervoidencode(ByteBuffer buffer, T value) Encode the value into the given buffergetCodec(byte sel) Get the codec for the given selectorstatic <T> DBCachedObjectStoreFactory.PrimitiveCodec<T> Get the codec for the given typebyteA byte value which identifies this codec's type as the selected typeThe class describingDBCachedObjectStoreFactory.PrimitiveCodec
-
Field Details
-
BOOL
Codec forboolean -
BYTE
Codec forbyte -
CHAR
Codec forchar -
SHORT
Codec forshort -
INT
Codec forint -
LONG
Codec forlong -
STRING
Codec forString -
BOOL_ARR
Codec forboolean[] -
BYTE_ARR
Codec forbyte[] -
CHAR_ARR
Codec forchar[] -
SHORT_ARR
Codec forshort[] -
INT_ARR
Codec forint[] -
LONG_ARR
Codec forlong[] -
STRING_ARR
Codec forString[] -
ADDRESS
static final DBCachedObjectStoreFactory.PrimitiveCodec<DBCachedObjectStoreFactory.RecAddress> ADDRESS -
RANGE
-
CODECS_BY_SELECTOR
-
CODECS_BY_CLASS
-
-
Method Details
-
getSelector
byte getSelector()A byte value which identifies this codec's type as the selected type- Returns:
- the selector
-
decode
Decode the value from the given buffer- Parameters:
buffer- the source buffer- Returns:
- the value
-
encode
Encode the value into the given buffer- Parameters:
buffer- the destination buffervalue- the value
-
getValueClass
The class describingDBCachedObjectStoreFactory.PrimitiveCodec- Returns:
- the class
-
getCodec
Get the codec for the given type- Type Parameters:
T- the type- Parameters:
cls- the class describingDBCachedObjectStoreFactory.PrimitiveCodec- Returns:
- the codec
- Throws:
IllegalArgumentException- if the type is not supported
-
getCodec
Get the codec for the given selector- Parameters:
sel- the selector- Returns:
- the codec
- Throws:
IllegalArgumentException- if the selector is unknown
-