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
  bea0ed01_a781_156d_ffc2_7b888e7bf015["accumulate()"]
  796bebf7_64ba_cc0c_f6dc_6e51f56f0bc9["get()"]
  bea0ed01_a781_156d_ffc2_7b888e7bf015 -->|calls| 796bebf7_64ba_cc0c_f6dc_6e51f56f0bc9
  ead471ec_3401_4ac5_247e_c17e9f46a9d0["checkName()"]
  bea0ed01_a781_156d_ffc2_7b888e7bf015 -->|calls| ead471ec_3401_4ac5_247e_c17e9f46a9d0
  0fcb93b3_4873_3258_b9e6_29138d183448["put()"]
  bea0ed01_a781_156d_ffc2_7b888e7bf015 -->|calls| 0fcb93b3_4873_3258_b9e6_29138d183448
  style bea0ed01_a781_156d_ffc2_7b888e7bf015 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

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