Interface JSONObject.Builder
- All Superinterfaces:
JSONNode.Builder
- Enclosing interface:
- JSONObject
Build
JSONObject instances- Author:
- cdivilly
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionAdd a boolean JSON propertyadd(String propertyName, CharSequence value) Add a String JSON propertyCreate a numeric JSON propertyAdd a property.Add a JSON property containing another JSON documentadd(JSONObject existing) Add all the properties in the existingJSONObjectto this object.Add a null propertybuild()Build theJSONNodeinstanceRemove the named property
-
Method Details
-
add
Add all the properties in the existingJSONObjectto this object.- Parameters:
existing- TheJSONObjectcontaining properties to be added- Returns:
- self
-
add
Add a property.- Parameters:
propertyName- The name of the propertyvalue- The value to add, must be an instance of one of the types specified here.- Returns:
- self
-
add
Add a boolean JSON property- Parameters:
propertyName- property namevalue- property value- Returns:
- self
-
add
Add a String JSON property- Parameters:
propertyName- property namevalue- property value- Returns:
- self
-
add
Add a JSON property containing another JSON document- Parameters:
propertyName- property namevalue- property value- Returns:
- self
-
add
Create a numeric JSON property- Parameters:
propertyName- property namevalue- property value- Returns:
- self
-
addNull
Add a null property- Parameters:
propertyName- property name- Returns:
- self
-
remove
Remove the named property- Parameters:
propertyName- The name of the property to remove- Returns:
- self
-
build
JSONObject build()Description copied from interface:JSONNode.BuilderBuild theJSONNodeinstance- Specified by:
buildin interfaceJSONNode.Builder- Returns:
JSONNodeinstance
-