app/src/main/java/org/andstatus/app/util/JsonUtils.java
/** Creates new shallow copy with new key, does nothing if key is empty or null */
Creates new shallow copy with new key, does nothing if key is empty or null
Creates new shallow copy with new key does nothing if key is empty or null
@NonNull
    public static JSONObject put(JSONObject jso, String key, Object value) {
        if (StringUtil.isEmpty(key)) {
            return jso == null ? new JSONObject() : jso;
        }
        JSONObject out = shallowCopy(jso);
        try {
            out.put(key, value);
        } catch (JSONException e) {
            MyLog.w(JsonUtils.class, "put '" + key + "'", e);
        }
        return out;
    }
@ NonNull public static JSONObject put ( JSONObject jso , String key , Object value ) { if ( StringUtil . isEmpty ( key ) ) { return jso == null ? new JSONObject ( ) : jso ; } JSONObject out = shallowCopy ( jso ) ; try { out . put ( key , value ) ; } catch ( JSONException e ) { MyLog . w ( JsonUtils . class , "put '" + key + "'" , e ) ; } return out ; }
Creates new shallow copy with new key, does nothing if key is empty or null
Creates new shallow copy with new key does nothing if key is empty or null