public static class DXJSON.ArrayBuilder extends Object
ArrayNode a = DXJSON.getArrayBuilder()
.add("Foo")
.addAllStrings(ImmutableList.of("Bar", "Baz"))
.build()
when serialized, produces the JSON array ["Foo", "Bar", "Baz"]
.Constructor and Description |
---|
ArrayBuilder()
Initializes an ArrayBuilder which will generate an empty array.
|
Modifier and Type | Method and Description |
---|---|
DXJSON.ArrayBuilder |
add(com.fasterxml.jackson.databind.JsonNode value)
Adds the specified JsonNode to the end of the array.
|
DXJSON.ArrayBuilder |
add(String value)
Adds the specified String to the end of the array.
|
DXJSON.ArrayBuilder |
addAll(List<com.fasterxml.jackson.databind.JsonNode> values)
Adds the specified JsonNode objects, in order, to the end of the
array.
|
DXJSON.ArrayBuilder |
addAllStrings(List<String> values)
Adds the specified String objects, in order, to the end of the array.
|
com.fasterxml.jackson.databind.node.ArrayNode |
build()
Generates a JSON array.
|
public ArrayBuilder()
public DXJSON.ArrayBuilder add(com.fasterxml.jackson.databind.JsonNode value)
public DXJSON.ArrayBuilder add(String value)
public DXJSON.ArrayBuilder addAll(List<com.fasterxml.jackson.databind.JsonNode> values)
public DXJSON.ArrayBuilder addAllStrings(List<String> values)
public com.fasterxml.jackson.databind.node.ArrayNode build()
Copyright © 2023. All Rights Reserved.