Class BasicParser<T>

java.lang.Object
com.amilesend.client.parse.parser.BasicParser<T>
Type Parameters:
T - the object type
All Implemented Interfaces:
GsonParser<T>

public class BasicParser<T> extends Object implements GsonParser<T>
Defines a basic GsonParser implementation for single object type.
  • Constructor Details

    • BasicParser

      public BasicParser(@NonNull @NonNull Class<T> clazz)
  • Method Details

    • parse

      public T parse(@NonNull @NonNull com.google.gson.Gson gson, @NonNull @NonNull InputStream jsonStream)
      Description copied from interface: GsonParser
      Deserializes a JSON-formatted input stream to the defined POJO type.
      Specified by:
      parse in interface GsonParser<T>
      Parameters:
      gson - the Gson instance used to deserialize the string
      jsonStream - stream with expected JSON-formatted contents
      Returns:
      the parsed POJO instance