This repository was archived by the owner on Nov 27, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Basic Usage
MatthewTGM edited this page Jun 30, 2021
·
1 revision
import xyz.matthewtgm.json.entities.JsonArray;
import xyz.matthewtgm.json.entities.JsonObject;
public class ExampleApplication {
public static ExampleApplication instance = new ExampleApplication();
public void start() {
JsonObject simpleObject = new JsonObject();
simpleObject.add("Hello,", "world!");
System.out.println(simpleObject);
JsonArray simpleArray = new JsonArray();
simpleArray.add("Hello World!");
System.out.println(simpleArray);
JsonObject builtObject = new JsonObject().add("Hi,", "Java!");
System.out.println(builtObject);
JsonArray builtArray = new JsonArray().add("Hi Java!");
System.out.println(builtArray);
}
public static void main(String[] args) {
ExampleApplication.instance.start();
}
}
Above is an example application to show the basic usage of the entity API. Entities can be built using their respective addition and removal methods and they can be used as "normal" objects where the methods are called seperately.