Interface JsonObjectMapper

All Known Implementing Classes:
DefaultGsonObjectMapper

public interface JsonObjectMapper
Represents the ability of serialize an object to JSON format string and deserialize it to the typed object.
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    <T> T
    fromJson(String value, Class<T> valueType)
    Perform deserialization from JSON format string to the given type object as argument.
    toJson(Object value)
    Perform serialization from object to JSON format string.
  • Method Details

    • fromJson

      <T> T fromJson(String value, Class<T> valueType)
      Perform deserialization from JSON format string to the given type object as argument.
      Type Parameters:
      T - the type object to convert
      Parameters:
      value - the JSON format
      valueType - the object type to convert
      Returns:
      the instance of an object to the type given argument
    • toJson

      String toJson(Object value)
      Perform serialization from object to JSON format string.
      Parameters:
      value - the object to convert
      Returns:
      the JSON format string