We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
import xyz.matthewtgm.json.entities.JsonObject; import xyz.matthewtgm.json.util.JsonHelper; public class PrettyExampleAppliation { public static PrettyExampleAppliation instance = new PrettyExampleAppliation(); public void start() { JsonObject object = new JsonObject().add("name", "Matthew").add("language", "Java"); String prettified = JsonHelper.makePretty(object, 2); System.out.println(prettified); System.out.println(JsonHelper.makeUnpretty(prettified)); } public static void main(String[] args) { PrettyExampleAppliation.instance.start(); } }
There's also a built-in JSON prettifier and unprettifier. This makes the JSON string have indents, which in turn makes it more read-able.