Class NativeMapper

java.lang.Object
org.rostore.client.mapper.NativeMapper
All Implemented Interfaces:
Mapper

public class NativeMapper extends Object implements Mapper
This one uses the native serializer of the ro-store
  • Constructor Details

  • Method Details

    • getMapperProperties

      public MapperProperties getMapperProperties()
    • fromObject

      public <K, V> InputStream fromObject(V value, K key)
      Serialization function
      Specified by:
      fromObject in interface Mapper
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      value - the value object
      key - the key object
      Returns:
      the serialized input stream
    • toObject

      public <K, V> V toObject(InputStream inputStream, Class<V> valueClass, K key)
      Deserialization function
      Specified by:
      toObject in interface Mapper
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      inputStream - the input stream to deserialize
      valueClass - the class of the value object
      key - the key object
      Returns:
      the deserialized value object
    • getContentType

      public ContentType getContentType()
      The content type of the input stream
      Specified by:
      getContentType in interface Mapper
      Returns:
      the content type used in the header