Package com.dnanexus
Class DXJSON.ObjectBuilder
- java.lang.Object
-
- com.dnanexus.DXJSON.ObjectBuilder
-
- Enclosing class:
- DXJSON
public static class DXJSON.ObjectBuilder extends Object
Builder class that generates a JSON object (hash). Example:
when serialized, produces the JSON objectObjectNode o = DXJSON.getObjectBuilder() .put("key1", "a-string") .put("key2", 12321) .build(){"key1": "a-string", "key2": 12321}.
-
-
Constructor Summary
Constructors Constructor Description ObjectBuilder()Initializes an ObjectBuilder which will generate an empty object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.fasterxml.jackson.databind.node.ObjectNodebuild()Generates a JSON object.DXJSON.ObjectBuilderput(String key, boolean value)Adds a key-value pair with a boolean value and returns the resulting ObjectBuilder.DXJSON.ObjectBuilderput(String key, double value)Adds a key-value pair with a numeric value and returns the resulting ObjectBuilder.DXJSON.ObjectBuilderput(String key, int value)Adds a key-value pair with a numeric value and returns the resulting ObjectBuilder.DXJSON.ObjectBuilderput(String key, long value)Adds a key-value pair with a numeric value and returns the resulting ObjectBuilder.DXJSON.ObjectBuilderput(String key, com.fasterxml.jackson.databind.JsonNode value)Adds a key-value pair with an arbitrary JsonNode value.DXJSON.ObjectBuilderput(String key, String value)Adds a key-value pair with a string value and returns the resulting ObjectBuilder.
-
-
-
Method Detail
-
put
public DXJSON.ObjectBuilder put(String key, com.fasterxml.jackson.databind.JsonNode value)
Adds a key-value pair with an arbitrary JsonNode value.
-
put
public DXJSON.ObjectBuilder put(String key, String value)
Adds a key-value pair with a string value and returns the resulting ObjectBuilder.
-
put
public DXJSON.ObjectBuilder put(String key, int value)
Adds a key-value pair with a numeric value and returns the resulting ObjectBuilder.
-
put
public DXJSON.ObjectBuilder put(String key, long value)
Adds a key-value pair with a numeric value and returns the resulting ObjectBuilder.
-
put
public DXJSON.ObjectBuilder put(String key, double value)
Adds a key-value pair with a numeric value and returns the resulting ObjectBuilder.
-
put
public DXJSON.ObjectBuilder put(String key, boolean value)
Adds a key-value pair with a boolean value and returns the resulting ObjectBuilder.
-
build
public com.fasterxml.jackson.databind.node.ObjectNode build()
Generates a JSON object.
-
-