Interface DataAPISerializer

All Known Implementing Classes:
DatabaseSerializer, DocumentSerializer, RowSerializer

public interface DataAPISerializer
Definition of a serializer for the Data API
  • Method Summary

    Modifier and Type
    Method
    Description
    default <T> T
    convertValue(Object bean, Class<T> clazz)
    Jackson deserialization.
    com.fasterxml.jackson.databind.ObjectMapper
    Access the Jackson Mapper
    default String
    Transform object as a String.
    default <T> T
    unMarshallBean(String body, Class<T> ref)
    Load body as expected object.
  • Method Details

    • getMapper

      com.fasterxml.jackson.databind.ObjectMapper getMapper()
      Access the Jackson Mapper
      Returns:
      jackson mapper
    • marshall

      default String marshall(Object o)
      Transform object as a String.
      Parameters:
      o - object to be serialized.
      Returns:
      body as String
    • convertValue

      default <T> T convertValue(Object bean, Class<T> clazz)
      Jackson deserialization.
      Type Parameters:
      T - current type
      Parameters:
      bean - current beam
      clazz - target class
      Returns:
      serialized
    • unMarshallBean

      default <T> T unMarshallBean(String body, Class<T> ref)
      Load body as expected object.
      Type Parameters:
      T - parameter
      Parameters:
      body - response body as String
      ref - type Reference to map the result
      Returns:
      expected objects