Home / Function/ accumulate() — spring-boot Function Reference

accumulate() — spring-boot Function Reference

Architecture documentation for the accumulate() function in JSONObject.java from the spring-boot codebase.

Entity Profile

Dependency Diagram

graph TD
  f474c5e0_56fa_a01c_d587_ca845da3b64e["accumulate()"]
  23d19be6_c283_52f7_8076_c235fe5e7e22["get()"]
  f474c5e0_56fa_a01c_d587_ca845da3b64e -->|calls| 23d19be6_c283_52f7_8076_c235fe5e7e22
  59222fba_9165_5465_0cca_487e85a43597["checkName()"]
  f474c5e0_56fa_a01c_d587_ca845da3b64e -->|calls| 59222fba_9165_5465_0cca_487e85a43597
  e3be2238_5db5_c42d_7dea_fc316e36c89c["put()"]
  f474c5e0_56fa_a01c_d587_ca845da3b64e -->|calls| e3be2238_5db5_c42d_7dea_fc316e36c89c
  style f474c5e0_56fa_a01c_d587_ca845da3b64e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

cli/spring-boot-cli/src/json-shade/java/org/springframework/boot/cli/json/JSONObject.java lines 303–324

	public JSONObject accumulate(String name, Object value) throws JSONException {
		Object current = this.nameValuePairs.get(checkName(name));
		if (current == null) {
			return put(name, value);
		}

		// check in accumulate, since array.put(Object) doesn't do any checking
		if (value instanceof Number) {
			JSON.checkDouble(((Number) value).doubleValue());
		}

		if (current instanceof JSONArray array) {
			array.put(value);
		}
		else {
			JSONArray array = new JSONArray();
			array.put(current);
			array.put(value);
			this.nameValuePairs.put(name, array);
		}
		return this;
	}

Domain

Subdomains

Frequently Asked Questions

What does accumulate() do?
accumulate() is a function in the spring-boot codebase.
What does accumulate() call?
accumulate() calls 3 function(s): checkName, get, put.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free