use of rxreddit.model.ModReport in project RxReddit by damien5314.
the class ModReportDeserializer method deserialize.
@Override
public ModReport deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {
JsonArray array = json.getAsJsonArray();
// Extract text element
JsonElement textElement = array.get(0);
String text = textElement instanceof JsonNull ? null : textElement.getAsString();
// Extract username element
String username = array.get(1).getAsString();
return new ModReport(text, username);
}
Aggregations