Interface IJsonConverter<T>

  • Type Parameters:
    T - the object type
    All Known Implementing Classes:
    JsonConverter

    public interface IJsonConverter<T>
    Provides a converter for building Ts as JSONObject, and vice-versa
    Author:
    Sebastien Briquet - sebfz1
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      com.github.openjson.JSONObject toJson​(T object)
      Converts a T object to a JSONObject
      T toObject​(com.github.openjson.JSONObject object)
      Converts a JSONObject to a {code T} object
    • Method Detail

      • toJson

        com.github.openjson.JSONObject toJson​(T object)
        Converts a T object to a JSONObject
        Parameters:
        object - the T object
        Returns:
        the JSONObject
      • toObject

        T toObject​(com.github.openjson.JSONObject object)
        Converts a JSONObject to a {code T} object
        Parameters:
        object - the JSONObject
        Returns:
        the {code T} object