Interface JsonMapping

  • All Known Implementing Classes:
    JacksonMapping, JsonBMapping

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

      • 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:
        Constant Field Values
    • Method Detail

      • 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