Code example for Gson

Methods: fromJson

0
		monitor.stop();
 
		// JSON parsing 
		JsonObject obj = (JsonObject)  resp.getJson();
		JsonArray monitors = obj.getAsJsonObject("play.CorePlugin").getAsJsonArray("monitors");
		Gson gson = new Gson();
        Type collectionType = new TypeToken<Collection<StatMonitor>>(){}.getType();
        List<StatMonitor> stats = gson.fromJson(monitors, collectionType);
         
        // Into cache 
        Cache.set("MonitorStats", stats);
	} 
} 
Contextual code suggestions in your IDE  Get Codota for Java