Package com.dnanexus
Class DXJSON.ArrayBuilder
- java.lang.Object
-
- com.dnanexus.DXJSON.ArrayBuilder
-
- Enclosing class:
- DXJSON
public static class DXJSON.ArrayBuilder extends Object
Builder class that generates a JSON array. Example:
when serialized, produces the JSON arrayArrayNode a = DXJSON.getArrayBuilder() .add("Foo") .addAllStrings(ImmutableList.of("Bar", "Baz")) .build()["Foo", "Bar", "Baz"].
-
-
Constructor Summary
Constructors Constructor Description ArrayBuilder()Initializes an ArrayBuilder which will generate an empty array.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DXJSON.ArrayBuilderadd(com.fasterxml.jackson.databind.JsonNode value)Adds the specified JsonNode to the end of the array.DXJSON.ArrayBuilderadd(String value)Adds the specified String to the end of the array.DXJSON.ArrayBuilderaddAll(List<com.fasterxml.jackson.databind.JsonNode> values)Adds the specified JsonNode objects, in order, to the end of the array.DXJSON.ArrayBuilderaddAllStrings(List<String> values)Adds the specified String objects, in order, to the end of the array.com.fasterxml.jackson.databind.node.ArrayNodebuild()Generates a JSON array.
-
-
-
Method Detail
-
add
public DXJSON.ArrayBuilder add(com.fasterxml.jackson.databind.JsonNode value)
Adds the specified JsonNode to the end of the array.
-
add
public DXJSON.ArrayBuilder add(String value)
Adds the specified String to the end of the array.
-
addAll
public DXJSON.ArrayBuilder addAll(List<com.fasterxml.jackson.databind.JsonNode> values)
Adds the specified JsonNode objects, in order, to the end of the array.
-
addAllStrings
public DXJSON.ArrayBuilder addAllStrings(List<String> values)
Adds the specified String objects, in order, to the end of the array.
-
build
public com.fasterxml.jackson.databind.node.ArrayNode build()
Generates a JSON array.
-
-