Interface JsonSerializer

  • All Known Implementing Classes:
    JacksonJsonSerializer

    @PublicSpi
    public interface JsonSerializer
    An interface for serializing and deserializing GraphQL objects.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      <T> T deserialize​(java.lang.String json, java.lang.Class<T> requiredType)
      Deserializes the given json String to an object of the required type.
      java.lang.String serialize​(java.lang.Object object)
      Serializes the given object to a json String.
    • Method Detail

      • serialize

        java.lang.String serialize​(java.lang.Object object)
        Serializes the given object to a json String.
        Parameters:
        object - the object to serialize
        Returns:
        the json string
      • deserialize

        <T> T deserialize​(java.lang.String json,
                          java.lang.Class<T> requiredType)
        Deserializes the given json String to an object of the required type.
        Type Parameters:
        T - the required generic type
        Parameters:
        json - the json string
        requiredType - the required type
        Returns:
        the object