Interface GsonParser<T>

Type Parameters:
T - the POJO type
All Known Implementing Classes:
BasicParser, ListParser, MapParser

public interface GsonParser<T>
Defines a parser that deserializes a JSON-formatted source input stream to the defined POJO type.
  • Method Summary

    Modifier and Type
    Method
    Description
    default T
    parse(@NonNull com.google.gson.Gson gson, @lombok.NonNull byte[] jsonContent)
    Deserializes a JSON-formatted byte array to the defined POJO type.
    parse(com.google.gson.Gson gson, InputStream jsonStream)
    Deserializes a JSON-formatted input stream to the defined POJO type.
  • Method Details

    • parse

      T parse(com.google.gson.Gson gson, InputStream jsonStream)
      Deserializes a JSON-formatted input stream to the defined POJO type.
      Parameters:
      gson - the Gson instance used to deserialize the string
      jsonStream - stream with expected JSON-formatted contents
      Returns:
      the parsed POJO instance
    • parse

      default T parse(@NonNull @NonNull com.google.gson.Gson gson, @NonNull @lombok.NonNull byte[] jsonContent) throws IOException
      Deserializes a JSON-formatted byte array to the defined POJO type.
      Parameters:
      gson - the Gson instance used to deserialize the string
      jsonContent - the byte array
      Returns:
      the parsed POJO instance
      Throws:
      IOException