public class Utf8StringCodec extends Object implements RedisCodec<String,String>
RedisCodec
that handles UTF-8 encoded keys and values.Constructor and Description |
---|
Utf8StringCodec()
Initialize a new instance that encodes and decodes strings using the UTF-8 charset;
|
Modifier and Type | Method and Description |
---|---|
String |
decodeKey(ByteBuffer bytes)
Decode the key output by redis.
|
String |
decodeValue(ByteBuffer bytes)
Decode the value output by redis.
|
ByteBuffer |
encodeKey(String key)
Encode the key for output to redis.
|
ByteBuffer |
encodeValue(String value)
Encode the value for output to redis.
|
public Utf8StringCodec()
public String decodeKey(ByteBuffer bytes)
RedisCodec
decodeKey
in interface RedisCodec<String,String>
bytes
- Raw bytes of the key.public String decodeValue(ByteBuffer bytes)
RedisCodec
decodeValue
in interface RedisCodec<String,String>
bytes
- Raw bytes of the value.public ByteBuffer encodeKey(String key)
RedisCodec
encodeKey
in interface RedisCodec<String,String>
key
- Key.public ByteBuffer encodeValue(String value)
RedisCodec
encodeValue
in interface RedisCodec<String,String>
value
- Value.Copyright © 2016. All rights reserved.