Package com.scaleout.client.caching
Class StringKeyEncoder
The
StringKeyEncoder
is an implementation of a KeyEncoder
for String
keys that is not
compatible with the SOSS-JNC API. To use String keys compatible with the SOSS-JNC API, use
LegacyStringKeyEncoder
.-
Constructor Summary
ConstructorDescriptionStringKeyEncoder
(StringKeyCache stringKeyCache) Instantiate a string key encoder with a string key cache. -
Method Summary
Modifier and TypeMethodDescriptionEncodes theString
key into aKeyEncodingResult
with a UTF-8 encoded key string.fromBytes
(byte[] keyAsBytes) Retrieves a UTF-8 string from the 32-byte encoded key string.
-
Constructor Details
-
StringKeyEncoder
Instantiate a string key encoder with a string key cache.- Parameters:
stringKeyCache
- the string key cache.
-
-
Method Details
-
fromBytes
Retrieves a UTF-8 string from the 32-byte encoded key string.- Specified by:
fromBytes
in classKeyEncoder<String>
- Parameters:
keyAsBytes
- the 32 byte encoded key- Returns:
- the key string
-
encode
Encodes theString
key into aKeyEncodingResult
with a UTF-8 encoded key string.- Specified by:
encode
in classKeyEncoder<String>
- Parameters:
key
- theInteger
key- Returns:
- the
KeyEncodingResult
-