Interface JSONArray.Builder
- All Superinterfaces:
JSONNode.Builder
- Enclosing interface:
- JSONArray
Build a
JSONArray instance- Author:
- cdivilly
-
Method Summary
Modifier and TypeMethodDescriptionAdd a boolean JSON valueadd(CharSequence value) Add a String JSON valueCreate a numeric JSON valueAdd a value to an array.Add a JSON value containing another JSON documentAdd all the items in the existingJSONArrayto this array.addNull()Add a null valuebuild()Build theJSONNodeinstance
-
Method Details
-
add
Add a boolean JSON value- Parameters:
value- boolean value- Returns:
- self
-
add
Add a String JSON value- Parameters:
value- textual value- Returns:
- self
-
add
Add a JSON value containing another JSON document- Parameters:
value-JSONObjectorJSONArrayvalue- Returns:
- self
-
add
Create a numeric JSON value- Parameters:
value- The numeric value- Returns:
- self
-
add
Add a value to an array. The value must be an instance ofBoolean,CharSequence,JSONNode,Number, or the null value.- Parameters:
value- A legal JSON data-type value- Returns:
- self
- Throws:
IllegalArgumentException- if the value is not one of the legal JSON data types.
-
addAll
Add all the items in the existingJSONArrayto this array.- Parameters:
existing- The array of elements to add- Returns:
- self
-
addNull
JSONArray.Builder addNull()Add a null value- Returns:
- self
-
build
JSONArray build()Description copied from interface:JSONNode.BuilderBuild theJSONNodeinstance- Specified by:
buildin interfaceJSONNode.Builder- Returns:
JSONNodeinstance
-