Top "Gson" questions

Gson is Google's open-source library for serializing and deserializing Java objects to/from JSON.

com.google.gson.internal.LinkedTreeMap cannot be cast to my class

I have some problems with getting my object from a JSON string. I got the class Product public class Product { …

java json casting gson
Kotlin Data Class from Json using GSON

I have Java POJO class like this: class Topic { @SerializedName("id") long id; @SerializedName("name") String name; } and I have …

java json gson kotlin data-class
class A declares multiple JSON fields

i have a class A which has some private fields and the same class extends another class B which also …

java json gson
How do I write a custom JSON deserializer for Gson?

I have a Java class, User: public class User { int id; String name; Timestamp updateDate; } And I receive a JSON …

java json gson deserialization
Retrofit Expected BEGIN_OBJECT but was BEGIN_ARRAY

I'm fairly new to JSON parsing, I'm using the Retrofit library of Square and ran into this problem. I'm trying …

java android json gson retrofit
Retrofit GSON serialize Date from json string into java.util.date

I am using the Retrofit library for my REST calls. Most of what I have done has been smooth as …

java android json gson retrofit
Deserializing Generic Types with GSON

I have some problems with implementation of Json Deserialization in my Android application (with Gson library) I've made class like …

java android json deserialization gson
Gson optional and required fields

How should one deal with Gsonand required versus optional fields? Since all fields are optional, I can't really fail my …

json gson
What is the basic purpose of @SerializedName annotation in Android using Gson

What is the basic purpose of @SerializedName annotation in Android using Gson? Give me some different examples. I can't understand …

java android json gson
Serialize java object with GSON

I would like to serialize this object to JSON String public class Person { public String id; public String name; public …

java json gson