Package com.itextpdf.commons.json
Class JsonObject
java.lang.Object
com.itextpdf.commons.json.JsonValue
com.itextpdf.commons.json.JsonObject
Class representing JSON object value.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new emptyJsonObject.JsonObject(Map<String, JsonValue> fields) Creates a newJsonObjectwith provided fields. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a new field into JSON object.booleanGets particular JSON object field.Gets a copy of the JSON object fields.inthashCode()voidRemoves a field from JSON object.Methods inherited from class com.itextpdf.commons.json.JsonValue
fromJson, toJson, toPrettifiedJson
-
Constructor Details
-
JsonObject
public JsonObject()Creates a new emptyJsonObject. -
JsonObject
Creates a newJsonObjectwith provided fields.- Parameters:
-
fields- fields to put into JSON object
-
-
Method Details
-
getFields
Gets a copy of the JSON object fields.- Returns:
- JSON object fields
-
getField
Gets particular JSON object field. -
add
Adds a new field into JSON object.- Parameters:
-
key- a key to add into JSON object fields -
value- a value to add into JSON object fields under thekey
-
remove
Removes a field from JSON object.- Parameters:
-
key- a key to remove a value for
-
equals
-
hashCode
public int hashCode()
-