add builder() method

This commit is contained in:
Jörg Prante 2023-02-01 18:59:21 +01:00
parent de875b95f6
commit ae10eb3485

View file

@ -36,6 +36,10 @@ public class JsonBuilder {
this.state = new State(null, 0, Structure.DOCSTART, true); this.state = new State(null, 0, Structure.DOCSTART, true);
} }
public static JsonBuilder builder() {
return new JsonBuilder();
}
public JsonBuilder beginCollection() throws IOException { public JsonBuilder beginCollection() throws IOException {
this.state = new State(state, state.level + 1, Structure.COLLECTION, true); this.state = new State(state, state.level + 1, Structure.COLLECTION, true);
appendable.append('['); appendable.append('[');