Package com.scaleout.client.caching
Class KeyEncoder<K>
java.lang.Object
com.scaleout.client.caching.KeyEncoder<K>
- Type Parameters:
K
- the key type
- Direct Known Subclasses:
ByteArrayKeyEncoder
,IntegerKeyEncoder
,LegacyStringKeyEncoder
,StringKeyEncoder
,UuidKeyEncoder
The
KeyEncoder
is used to transform a K
key into an array of 32 bytes.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract KeyEncodingResult
Encodes aK
key into an array of 32-bytes.abstract K
fromBytes
(byte[] keyAsBytes) Retrieves a encoded key.
-
Constructor Details
-
KeyEncoder
public KeyEncoder()Construct aKeyEncoder
.
-
-
Method Details
-
fromBytes
Retrieves a encoded key.- Parameters:
keyAsBytes
- the 32 byte encoded key- Returns:
- the
K
key
-
encode
Encodes aK
key into an array of 32-bytes.- Parameters:
key
- theK
key- Returns:
- a
KeyEncodingResult
-