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

nested() — spring-boot Function Reference

Architecture documentation for the nested() function in ContextPairs.java from the spring-boot codebase.

Function java GradlePlugin AotProcessing calls 4 called by 1

Entity Profile

Dependency Diagram

graph TD
  36e2d633_5a78_f372_fdb1_fe36c2864aa0["nested()"]
  deb140ea_5f8f_4b97_e681_0ecb26122f6b["nested()"]
  deb140ea_5f8f_4b97_e681_0ecb26122f6b -->|calls| 36e2d633_5a78_f372_fdb1_fe36c2864aa0
  deb140ea_5f8f_4b97_e681_0ecb26122f6b["nested()"]
  36e2d633_5a78_f372_fdb1_fe36c2864aa0 -->|calls| deb140ea_5f8f_4b97_e681_0ecb26122f6b
  3c34fdcb_17ee_1b86_3216_2c3c291db02d["joining()"]
  36e2d633_5a78_f372_fdb1_fe36c2864aa0 -->|calls| 3c34fdcb_17ee_1b86_3216_2c3c291db02d
  f31e925b_4d27_d922_e3a7_af3489260469["assertNotDuplicateNestedPairs()"]
  36e2d633_5a78_f372_fdb1_fe36c2864aa0 -->|calls| f31e925b_4d27_d922_e3a7_af3489260469
  b3154819_1aa7_956c_ad3c_080696312bf2["toString()"]
  36e2d633_5a78_f372_fdb1_fe36c2864aa0 -->|calls| b3154819_1aa7_956c_ad3c_080696312bf2
  style 36e2d633_5a78_f372_fdb1_fe36c2864aa0 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

core/spring-boot/src/main/java/org/springframework/boot/logging/structured/ContextPairs.java lines 191–220

		@SuppressWarnings("unchecked")
		void nested(T item, BiConsumer<String, Object> pairs) {
			LinkedHashMap<String, Object> result = new LinkedHashMap<>();
			this.addedPairs.forEach((addedPair) -> {
				addedPair.accept(item, joining((name, value) -> {
					StringBuilder part = new StringBuilder(name.length());
					int length = (!name.endsWith(".")) ? name.length() : name.length() - 1;
					Map<String, Object> destination = result;
					for (int i = 0; i < length; i++) {
						char ch = name.charAt(i);
						if (i == length - 1) {
							part.append(ch);
							Object previous = destination.put(part.toString(), value);
							assertNotDuplicateNestedPairs(previous == null, name, length);
						}
						else if (ch == '.') {
							Object current = destination.computeIfAbsent(part.toString(),
									(key) -> new LinkedHashMap<>());
							assertNotDuplicateNestedPairs(current instanceof Map, name, i);
							destination = (Map<String, Object>) current;
							part.setLength(0);
						}
						else {
							part.append(ch);
						}
					}
				}));
			});
			result.forEach(pairs);
		}

Domain

Subdomains

Calls

Called By

Frequently Asked Questions

What does nested() do?
nested() is a function in the spring-boot codebase.
What does nested() call?
nested() calls 4 function(s): assertNotDuplicateNestedPairs, joining, nested, toString.
What calls nested()?
nested() is called by 1 function(s): nested.

Analyze Your Own Codebase

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

Try Supermodel Free