public class HashKeyFieldCodec extends DefaultKeyFieldCodec implements KeyFieldCodec
KeyFieldCodec which emits hash value bytes for
the DataType specific byte representation for the given value.
This codec saves on space by terminating with the minimum added bytes possible for the hashed bytes for the native
DataType.Type,
DataFlavor,
HashAlgorithmName| Modifier and Type | Field and Description |
|---|---|
protected HashAlgorithmName |
hashName |
keyField| Constructor and Description |
|---|
HashKeyFieldCodec(KeyFieldMapping keyField,
HashAlgorithmName hash) |
| 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.
|
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.
|
protected HashAlgorithmName hashName
public HashKeyFieldCodec(KeyFieldMapping keyField, HashAlgorithmName hash)
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 Object decode(byte[] value)
KeyFieldCodecdecode in interface KeyFieldCodecvalue - encoded bytes valuepublic byte[] encodeNext(Object value)
KeyFieldCodecencodeNext in interface KeyFieldCodecvalue - the object or literal valueCopyright © 2024. All Rights Reserved.