public class StringKeyEncoder extends KeyEncoder<java.lang.String>
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 and Description |
---|
StringKeyEncoder(StringKeyCache stringKeyCache)
Instantiate a string key encoder with a string key cache.
|
Modifier and Type | Method and Description |
---|---|
KeyEncodingResult |
encode(java.lang.String key)
Encodes the
String key into a KeyEncodingResult with a UTF-8 encoded key string. |
java.lang.String |
fromBytes(byte[] keyAsBytes)
Retrieves a UTF-8 string from the 32-byte encoded key string.
|
public StringKeyEncoder(StringKeyCache stringKeyCache)
stringKeyCache
- the string key cache.public java.lang.String fromBytes(byte[] keyAsBytes)
fromBytes
in class KeyEncoder<java.lang.String>
keyAsBytes
- the 32 byte encoded keypublic KeyEncodingResult encode(java.lang.String key)
String
key into a KeyEncodingResult
with a UTF-8 encoded key string.encode
in class KeyEncoder<java.lang.String>
key
- the Integer
keyKeyEncodingResult