Class ListParser<T>

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

public class ListParser<T> extends Object implements GsonParser<List<T>>
Defines a GsonParser implementation for a list of objects.
  • Constructor Summary

    Constructors
    Constructor
    Description
    ListParser(@NonNull Class<T> clazz)
    Creates a new ListParser for the given class type.
  • Method Summary

    Modifier and Type
    Method
    Description
    parse(@NonNull com.google.gson.Gson gson, @NonNull InputStream jsonStream)
    Deserializes a JSON-formatted input stream to the defined POJO type.

    Methods inherited from class Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface GsonParser

    parse
    Modifier and Type
    Method
    Description
    default List<T>
    parse(@NonNull com.google.gson.Gson gson, byte @NonNull [] jsonContent)
    Deserializes a JSON-formatted byte array to the defined POJO type.
  • Constructor Details

    • ListParser

      public ListParser(@NonNull Class<T> clazz)
      Creates a new ListParser for the given class type.
      Parameters:
      clazz - the class type
  • Method Details

    • parse

      public List<T> parse(@NonNull com.google.gson.Gson gson, @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