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 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