public class NativeKeyFieldCodec extends DefaultKeyFieldCodec implements KeyFieldCodec
KeyFieldCodec which emits the DataType
specific native byte representation for the given value. This codec cannot be
used for composite row keys, as the native encoding of say integral types may
easily result in, for example one byte out of a 4-byte int being the same
byte/char as the declared delimiter field. Support for certain binary
compatible delimiter characters like '\0' should be explored.
This codec saves on space by terminating with the minimum added bytes possible for the native
DataType.Type,
DataFlavorkeyField| Constructor and Description |
|---|
NativeKeyFieldCodec(KeyFieldMapping keyField) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkEncodeOverflow(byte[] keyValue)
Returns true if the given encoded value will overflow the underlying key
field.
|
Object |
decode(byte[] value)
Returns the object representation for the given encoded bytes value.
|
byte[] |
encode(Object value)
Returns the encoded bytes representation for the given object or literal
value.
|
byte[] |
encodeNext(Object value)
Returns the encoded "next" bytes representation for the given object or
literal value, where the next value depends on the coded implementation and
may typically be the lexicographic next value.
|
org.plasma.sdo.DataFlavor |
getDataFlavor() |
boolean |
isLexicographic()
Return true if the encoded values support lexicographic ordering.
|
boolean |
isTransforming()
Return true if the encoded values are fundamentally transformed father than
formatted or padded in some way.
|
public NativeKeyFieldCodec(KeyFieldMapping keyField)
public boolean isLexicographic()
KeyFieldCodecisLexicographic in interface KeyFieldCodecpublic boolean isTransforming()
KeyFieldCodecisTransforming in interface KeyFieldCodecpublic byte[] encode(Object value)
KeyFieldCodecencode in interface KeyFieldCodecvalue - the object or literal valuepublic boolean checkEncodeOverflow(byte[] keyValue)
KeyFieldCodeccheckEncodeOverflow in interface KeyFieldCodecpublic byte[] encodeNext(Object value)
KeyFieldCodecencodeNext in interface KeyFieldCodecvalue - the object or literal valuepublic Object decode(byte[] value)
KeyFieldCodecdecode in interface KeyFieldCodecvalue - encoded bytes valuepublic org.plasma.sdo.DataFlavor getDataFlavor()
Copyright © 2024. All Rights Reserved.