With Gson, you’d just need to do something like:
List<Video> videos = gson.fromJson(json, new TypeToken<List<Video>>(){}.getType());
You might also need to provide a no-arg constructor on the Video
class you’re deserializing to.
More Related Contents:
- Deserialize a List object with Gson?
- Get nested JSON object with GSON using retrofit
- Polymorphism with gson
- Retrofit Expected BEGIN_OBJECT but was BEGIN_ARRAY
- Gson – convert from Json to a typed ArrayList
- What is the basic purpose of @SerializedName annotation in Android using Gson
- Using GSON to parse a JSON array
- Query a JSONObject in java
- Deserializing Generic Types with GSON
- Java 8 LocalDateTime deserialized using Gson
- how to parse JSON file with GSON
- How to prevent Gson from converting a long number (a json string ) to scientific notation format?
- How to convert a String to JsonObject using gson library
- Remove empty collections from a JSON with Gson
- How do I implement TypeAdapterFactory in Gson?
- Parsing nested JSON data using GSON
- Skip root element while deserializing json
- Gson: Is there an easier way to serialize a map
- Jsonpath with Jackson or Gson
- com.google.gson.internal.LinkedTreeMap cannot be cast to my class [duplicate]
- How to keep fields sequence in Gson serialization
- Java – Gson parsing nested within nested
- GSON: How to get a case insensitive element from Json?
- GSON: how to prevent StackOverflowError while keeping circular references?
- Using gson to deserialize specific JSON field of an object
- Gson custom deseralizer for one variable in an object
- How to serialize Optional classes with Gson?
- GSON does not deserialize reference to outer class
- Retrofit GSON serialize Date from json string into java.util.date
- How to handle a NumberFormatException with Gson in deserialization a JSON response