Package com.dnanexus

Class DXJSON.ArrayBuilder

  • Enclosing class:
    DXJSON

    public static class DXJSON.ArrayBuilder
    extends Object
    Builder class that generates a JSON array. Example:
     
     ArrayNode a = DXJSON.getArrayBuilder()
                         .add("Foo")
                         .addAllStrings(ImmutableList.of("Bar", "Baz"))
                         .build()
    when serialized, produces the JSON array ["Foo", "Bar", "Baz"].
    • Constructor Detail

      • ArrayBuilder

        public ArrayBuilder()
        Initializes an ArrayBuilder which will generate an empty array.
    • Method Detail

      • add

        public DXJSON.ArrayBuilder add​(com.fasterxml.jackson.databind.JsonNode value)
        Adds the specified JsonNode 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.