public class JsonBuilder extends Object
| Constructor and Description |
|---|
JsonBuilder() |
| Modifier and Type | Method and Description |
|---|---|
List<Object> |
list()
Creates a JSON object (represented by a
List). |
Map<String,Object> |
map()
Creates a JSON object (represented by a
Map). |
JsonBuilder |
put(Map<String,Object> map,
String name,
Object value)
Adds a key/value pair to a JSON object.
|
JsonBuilder |
putIf(Map<String,Object> map,
String name,
Object value)
Adds a key/value pair to a JSON object if the value is not null.
|
String |
toJsonString(Object o)
Serializes an object consisting of maps, lists and atoms into a JSON
string.
|
Copyright © 2012–2015 The Apache Software Foundation. All rights reserved.