Json - Redstonecrafter0/RedstoneAPI GitHub Wiki

json-simple

pretty-print

The RedstoneAPI provides a fork of json-simple that provides pretty printing on JSONObject and JSONArray of Gson.

JSONObject obj = new JSONObject();
String prettyObjectString = obj.toPrettyJsonString();
JSONArray arr = new JSONArray();
String prettyArrayString = arr.toPrettyJsonString();

get-values

To get the values of the JSONArray and JSONObject it is now possible to instead of casting every value directly get the wanted object. Here is an example for getting a String.

JSONObject obj = new JSONObject();
obj.put("test", "test");
String text = obj.getString("test);