I have a tree object in JSON format I\'m trying to deserialize with Gson. Each node contains its child nodes as fields of object type Node. Node is an interface, which has
You have to use TypeToken class from Google Gson. You will need of course has a generic class T to make it works
TypeToken
Type fooType = new TypeToken>() {}.getType();
gson.toJson(foo, fooType);
gson.fromJson(json, fooType);