Package org.rostore.client.mapper
Class StringMapper
java.lang.Object
org.rostore.client.mapper.StringMapper
- All Implemented Interfaces:
Mapper
This one can only work with the keys of type
String.
If any other type is provided an exception is thrown.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<K,V> InputStream fromObject(V value, K key) Serialization functionThe content type of the input stream<K,V> V toObject(InputStream inputStream, Class<V> valueClass, K key) Deserialization function
-
Constructor Details
-
StringMapper
public StringMapper()
-
-
Method Details
-
fromObject
Serialization function- Specified by:
fromObjectin interfaceMapper- Type Parameters:
K- the key typeV- the value type- Parameters:
value- the value objectkey- the key object- Returns:
- the serialized input stream
-
toObject
Deserialization function -
getContentType
The content type of the input stream- Specified by:
getContentTypein interfaceMapper- Returns:
- the content type used in the header
-