Updates this BoxJSONObject using the information in a JSON object.
@param jsonObject the JSON object containing updated information.
542983
void update(JsonObject jsonObject) {
        for (JsonObject.Member member : jsonObject) {
            if (member.getValue().isNull()) {
                continue;
            }

            this.parseJSONMember(member);
        }

        this.clearPendingChanges();
    }
468136
public JsonObject merge(JsonObject another) {
        for (Map.Entry<String, JsonElement> anotherEntry : another) {
            JsonElement curr = this.opt(anotherEntry.getKey());
            if (curr == null) {
                try {
                    this.put(anotherEntry.getKey(), anotherEntry.getValue());
                } catch (JsonException e) {
                    e.printStackTrace();
                }
            } else if (curr.isJsonObject() && anotherEntry.getValue().isJsonObject()) {
                curr.asJsonObject().merge(anotherEntry.getValue().asJsonObject());
            }
        }
        return this;
    }
858923
public void setObjects(Object object) {
        if (Collection.class.isAssignableFrom(object.getClass())) {
            this.objects = (Collection) object;
        }
    }
1119495
public void writeObject(Object object)
        throws IOException
    {
        if (object == null) {
            writeNull();
            return;
        }

        Serializer serializer;

        serializer = _serializerFactory.getSerializer(object.getClass());

        serializer.writeObject(object, this);
    }
842818
@Override
	public void setObject(Serializable object) throws JMSException
    {
    	if (bodyIsReadOnly)
    		throw new MessageNotWriteableException("Message body is read-only");
    	
    	assertDeserializationLevel(MessageSerializationLevel.FULL);
    	
        if (object == null)
        {
            body = null;
            return;
        }
        
        try
        {
        	body = SerializationTools.toByteArray(object);
        }
        catch (Exception e)
        {
        	throw new FFMQException("Cannot serialize object message body","MESSAGE_ERROR",e);
        }
    }
905437
public @Nonnull JsonBuilder put(String key, boolean b) {
        object.put(key, primitive(b));
        return this;
    }
1177650
public void updateInfo(BoxTermsOfServiceUserStatus.Info info) {
        URL url = TERMS_OF_SERVICE_USER_STATUSES_TEMPLATE.build(this.getAPI().getBaseURL(), this.getID());
        BoxJSONRequest request = new BoxJSONRequest(this.getAPI(), url, "PUT");
        request.setBody(info.getPendingChanges());

        BoxJSONResponse response = (BoxJSONResponse) request.send();
        JsonObject responseJSON = JsonObject.readFrom(response.getJSON());
        info.update(responseJSON);
    }
1338940
private void parseJSON(JsonObject jsonObject) {
        for (JsonObject.Member member : jsonObject) {
            JsonValue value = member.getValue();
            if (value.isNull()) {
                continue;
            }

            try {
                String memberName = member.getName();
                if (memberName.equals("id")) {
                    this.versionID = value.asString();
                } else if (memberName.equals("sha1")) {
                    this.sha1 = value.asString();
                } else if (memberName.equals("name")) {
                    this.name = value.asString();
                } else if (memberName.equals("size")) {
                    this.size = Double.valueOf(value.toString()).longValue();
                } else if (memberName.equals("created_at")) {
                    this.createdAt = BoxDateFormat.parse(value.asString());
                } else if (memberName.equals("modified_at")) {
                    this.modifiedAt = BoxDateFormat.parse(value.asString());
                } else if (memberName.equals("trashed_at")) {
                    this.trashedAt = BoxDateFormat.parse(value.asString());
                } else if (memberName.equals("modified_by")) {
                    JsonObject userJSON = value.asObject();
                    String userID = userJSON.get("id").asString();
                    BoxUser user = new BoxUser(getAPI(), userID);
                    this.modifiedBy = user.new Info(userJSON);
                }
            } catch (ParseException e) {
                assert false : "A ParseException indicates a bug in the SDK.";
            }
        }
    }
591381
private boolean updateExistingObject(DBObject dbObj, Map<String, String> currScalarMap) {
        if (objectIsChangingShards(dbObj, currScalarMap)) {
            return updateShardedObjectMove(dbObj);
        } else {
            return updateObjectSameShard(dbObj, currScalarMap);
        }
    }
36532
public function handleStorage($fieldObject)
    {
        $type = $fieldObject->getStorageType();
        $typeName = $type->getName();
        if ($typeName === 'json') {
            /** @deprecated since 3.3 to be renamed in v4. */
            $typeName = 'json_array';
        }
        $typeCol = 'value_' . $typeName;
        $this->$typeCol = $this->getValue();
    }
639775
public void ojbAdd(Object anObject)
    {
        DSetEntry entry = prepareEntry(anObject);
        entry.setPosition(elements.size());
        elements.add(entry);
    }
1102035
public void update( JSONObject json )
    {
        accessToken = json.getString( ACCESS_TOKEN );
        tokenType = json.getString( TOKEN_TYPE );
        expiresAt = calculateExpiresAt( json );
        if ( json.has( OAuth2.REFRESH_TOKEN ) ) {
            refreshToken = json.getString( OAuth2.REFRESH_TOKEN );
        }
    }
585293
private JsonObject getPendingJSONObject() {
        for (Map.Entry<String, BoxJSONObject> entry : this.children.entrySet()) {
            BoxJSONObject child = entry.getValue();
            JsonObject jsonObject = child.getPendingJSONObject();
            if (jsonObject != null) {
                if (this.pendingChanges == null) {
                    this.pendingChanges = new JsonObject();
                }

                this.pendingChanges.set(entry.getKey(), jsonObject);
            }
        }
        return this.pendingChanges;
    }
16973
@SuppressWarnings({ "rawtypes", "unchecked" })
    private void writeJSON(Object value) throws JSONException {
        if (JSONObject.NULL.equals(value)) {
            write(zipNull, 3);
        } else if (Boolean.FALSE.equals(value)) {
            write(zipFalse, 3);
        } else if (Boolean.TRUE.equals(value)) {
            write(zipTrue, 3);
        } else {
            if (value instanceof Map) {
                value = new JSONObject((Map) value);
            } else if (value instanceof Collection) {
                value = new JSONArray((Collection) value);
            } else if (value.getClass().isArray()) {
                value = new JSONArray(value);
            }
            if (value instanceof JSONObject) {
                write((JSONObject) value);
            } else if (value instanceof JSONArray) {
                write((JSONArray) value);
            } else {
                throw new JSONException("Unrecognized object");
            }
        }
    }
958117
public void setSelectedObject(final T newSelectedObject) {
		if (newSelectedObject != null) {
			final List<T> newSelectedList = new ArrayList<>(1);
			newSelectedList.add(newSelectedObject);
			setSelectedList(newSelectedList);
		} else {
			clearSelection();
		}
	}
190200
public static Set<String> getKeys(JSONObject jsonObject) {
        Set<String> keys = new TreeSet<String>();
        Iterator<?> iter = jsonObject.keys();
        while (iter.hasNext()) {
            keys.add((String) iter.next());
        }
        return keys;
    }
310991
public static void startActivity(@NonNull Context context, @Nullable JSONObject jsonObject) {
        Intent intent = new Intent(context, JSONViewerActivity.class);
        Bundle bundle = new Bundle();
        if (jsonObject != null) {
            bundle.putString(JSON_OBJECT_STATE, jsonObject.toString());
        }
        intent.putExtras(bundle);
        context.startActivity(intent);
    }