MCPcopy Create free account
hub / github.com/MCBans/MCBans / putOpt

Method putOpt

src/main/java/com/mcbans/plugin/org/json/JSONObject.java:1133–1138  ·  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 JSONObject.NULL object. @retu

(String key, Object value)

Source from the content-addressed store, hash-verified

1131 * @throws JSONException If the value is a non-finite number.
1132 */
1133 public JSONObject putOpt(String key, Object value) throws JSONException {
1134 if (key != null && value != null) {
1135 put(key, value);
1136 }
1137 return this;
1138 }
1139
1140
1141 /**

Callers 1

JSONObjectMethod · 0.95

Calls 1

putMethod · 0.95

Tested by

no test coverage detected