use of rxreddit.model.Listing in project RxReddit by damien5314.
the class CommentDeserializer method deserialize.
@Override
public Listing deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {
JsonObject o = json.getAsJsonObject();
String kind = o.get("kind").getAsString();
Listing listing;
switch(kind) {
case "t1":
listing = context.deserialize(json, Comment.class);
return listing;
case "more":
listing = context.deserialize(json, CommentStub.class);
return listing;
default:
return null;
}
}
Aggregations