T
- The type of the element handled by this RedisMapper
public interface RedisMapper<T> extends Function, Serializable
Example:
private static class RedisTestMapper implements RedisMapper<Tuple2<String, String>> {
public RedisDataTypeDescription getCommandDescription() {
return new RedisDataTypeDescription(RedisCommand.PUBLISH);
}
public String getKeyFromData(Tuple2<String, String> data) {
return data.f0;
}
public String getValueFromData(Tuple2<String, String> data) {
return data.f1;
}
}
Modifier and Type | Method and Description |
---|---|
RedisCommandDescription |
getCommandDescription()
Returns descriptor which defines data type.
|
String |
getKeyFromData(T data)
Extracts key from data.
|
String |
getValueFromData(T data)
Extracts value from data.
|
RedisCommandDescription getCommandDescription()
String getKeyFromData(T data)
data
- source dataCopyright © 2014–2017 The Apache Software Foundation. All rights reserved.