Interface JsonMapping


public interface JsonMapping
Interface to abstract json serialization to/from string.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Default priority of corresponding provider.
  • Method Summary

    Modifier and Type
    Method
    Description
    <T> T
    fromJson(String str, Class<T> type)
    Deserialize an object from it's JSON string representation.
    toJson(Object object)
    Serialize an object to JSON.
  • Field Details

    • DEFAULT_PRIORITY

      static final int DEFAULT_PRIORITY
      Default priority of corresponding provider.
      Implementation Note:
      could be used to control the load/init order in case multiple providers are specified/included.
      See Also:
  • Method Details

    • toJson

      String toJson(Object object)
      Serialize an object to JSON.
      Parameters:
      object - object to serialize
      Returns:
      JSON representation of the object
    • fromJson

      <T> T fromJson(String str, Class<T> type)
      Deserialize an object from it's JSON string representation.
      Type Parameters:
      T - generic parametrization class
      Parameters:
      str - JSON string
      type - type of object
      Returns:
      object of requested class