MCPcopy
hub / github.com/google/gson / add

Method add

src/main/java/com/google/gson/JsonObject.java:56–61  ·  view source on GitHub ↗

Adds a member, which is a name-value pair, to self. The name must be a String, but the value can be an arbitrary JsonElement, thereby allowing you to build a full tree of JsonElements rooted at this node. @param property name of the member. @param value the member object.

(String property, JsonElement value)

Source from the content-addressed store, hash-verified

54 * @param value the member object.
55 */
56 public void add(String property, JsonElement value) {
57 if (value == null) {
58 value = JsonNull.createJsonNull();
59 }
60 members.put($Gson$Preconditions.checkNotNull(property), value);
61 }
62
63 /**
64 * Removes the {@code property} from this {@link JsonObject}.

Calls 2

createJsonNullMethod · 0.95
checkNotNullMethod · 0.80