MCPcopy Index your code
hub / github.com/VolmitSoftware/Adapt / putOpt

Method putOpt

src/main/java/com/volmit/adapt/util/JSONObject.java:1449–1454  ·  view source on GitHub ↗

Put a key/value pair in the JSONObject, but only if the key and the value are both non-null. @param key A key string. @param value An object which is the value. It should be of one of these types: Boolean, Double, Integer, JSONArray, JSONObject, Long, String, or the JSON

(String key, Object value)

Source from the content-addressed store, hash-verified

1447 * @throws JSONException If the value is a non-finite number.
1448 */
1449 public JSONObject putOpt(String key, Object value) throws JSONException {
1450 if (key != null && value != null) {
1451 this.put(key, value);
1452 }
1453 return this;
1454 }
1455
1456 /**
1457 * Remove a name and its value, if present.

Callers 1

JSONObjectMethod · 0.95

Calls 1

putMethod · 0.95

Tested by

no test coverage detected