Example usage for Java com.google.gson JsonObject fields, constructors, methods, implement or subclass
The text is from its open source code.
void | add(String property, JsonElement value) Adds a member, which is a name-value pair, to self. |
void | addProperty(String property, String value) Convenience method to add a primitive member. |
void | addProperty(String property, Number value) Convenience method to add a primitive member. |
void | addProperty(String property, Boolean value) Convenience method to add a boolean member. |
void | addProperty(String property, Character value) Convenience method to add a char member. |
JsonObject | deepCopy() Creates a deep copy of this element and all its children |
Set | entrySet() Returns a set of members of this object. |
boolean | equals(Object o) |
JsonElement | get(String memberName) Returns the member with the specified name. |
boolean | getAsBoolean() convenience method to get this element as a boolean value. |
int | getAsInt() convenience method to get this element as a primitive integer value. |
JsonArray | getAsJsonArray(String memberName) Convenience method to get the specified member as a JsonArray. |
JsonArray | getAsJsonArray() convenience method to get this element as a JsonArray . |
JsonObject | getAsJsonObject(String memberName) Convenience method to get the specified member as a JsonObject. |
JsonObject | getAsJsonObject() convenience method to get this element as a JsonObject . |
JsonPrimitive | getAsJsonPrimitive(String memberName) Convenience method to get the specified member as a JsonPrimitive element. |
Number | getAsNumber() convenience method to get this element as a Number . |
String | getAsString() convenience method to get this element as a string value. |
boolean | has(String memberName) Convenience method to check if a member with the specified name is present in this object. |
int | hashCode() |
boolean | isJsonNull() provides check for verifying if this element represents a null value or not. |
boolean | isJsonObject() provides check for verifying if this element is a Json object or not. |
boolean | isJsonPrimitive() provides check for verifying if this element is a primitive or not. |
Set | keySet() Returns a set of members key values. |
JsonElement | remove(String property) Removes the property from this JsonObject . |
int | size() Returns the number of key/value pairs in the object. |
String | toString() Returns a String representation of this element. |