Interface JSONObject.Builder
-
- All Superinterfaces:
JSONNode.Builder
- Enclosing interface:
- JSONObject
public static interface JSONObject.Builder extends JSONNode.Builder
BuildJSONObjectinstances- Author:
- cdivilly
- See Also:
JSONObjects.object()
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description JSONObject.Builderadd(java.lang.String propertyName, java.lang.Boolean value)Add a boolean JSON propertyJSONObject.Builderadd(java.lang.String propertyName, java.lang.CharSequence value)Add a String JSON propertyJSONObject.Builderadd(java.lang.String propertyName, java.lang.Number value)Create a numeric JSON propertyJSONObject.Builderadd(java.lang.String propertyName, java.lang.Object value)Add a property.JSONObject.Builderadd(java.lang.String propertyName, JSONNode value)Add a JSON property containing another JSON documentJSONObject.Builderadd(JSONObject existing)Add all the properties in the existingJSONObjectto this object.JSONObject.BuilderaddNull(java.lang.String propertyName)Add a null propertyJSONObjectbuild()Build theJSONNodeinstanceJSONObject.Builderremove(java.lang.String propertyName)Remove the named property
-
-
-
Method Detail
-
add
JSONObject.Builder add(JSONObject existing)
Add all the properties in the existingJSONObjectto this object.- Parameters:
existing- TheJSONObjectcontaining properties to be added- Returns:
- self
-
add
JSONObject.Builder add(java.lang.String propertyName, java.lang.Object value)
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
JSONObject.Builder add(java.lang.String propertyName, java.lang.Boolean value)
Add a boolean JSON property- Parameters:
propertyName- property namevalue- property value- Returns:
- self
-
add
JSONObject.Builder add(java.lang.String propertyName, java.lang.CharSequence value)
Add a String JSON property- Parameters:
propertyName- property namevalue- property value- Returns:
- self
-
add
JSONObject.Builder add(java.lang.String propertyName, JSONNode value)
Add a JSON property containing another JSON document- Parameters:
propertyName- property namevalue- property value- Returns:
- self
-
add
JSONObject.Builder add(java.lang.String propertyName, java.lang.Number value)
Create a numeric JSON property- Parameters:
propertyName- property namevalue- property value- Returns:
- self
-
addNull
JSONObject.Builder addNull(java.lang.String propertyName)
Add a null property- Parameters:
propertyName- property name- Returns:
- self
-
remove
JSONObject.Builder remove(java.lang.String propertyName)
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
-
-