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
  2f23e2c1_a028_a35e_d894_f3f4a4eebc38["accumulate()"]
  a50303b0_fe68_9acb_a34d_5b51d45ddbcd["get()"]
  2f23e2c1_a028_a35e_d894_f3f4a4eebc38 -->|calls| a50303b0_fe68_9acb_a34d_5b51d45ddbcd
  a70f55b3_d9b2_7ed9_a631_1c885a918f28["checkName()"]
  2f23e2c1_a028_a35e_d894_f3f4a4eebc38 -->|calls| a70f55b3_d9b2_7ed9_a631_1c885a918f28
  1bc3a0b6_6045_ed66_1f89_1c6fe5c3d27f["put()"]
  2f23e2c1_a028_a35e_d894_f3f4a4eebc38 -->|calls| 1bc3a0b6_6045_ed66_1f89_1c6fe5c3d27f
  style 2f23e2c1_a028_a35e_d894_f3f4a4eebc38 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

configuration-metadata/spring-boot-configuration-metadata/src/json-shade/java/org/springframework/boot/configurationmetadata/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