flatten() — spring-boot Function Reference
Architecture documentation for the flatten() function in CloudFoundryVcapEnvironmentPostProcessor.java from the spring-boot codebase.
Entity Profile
Dependency Diagram
graph TD 93112add_a711_264e_9059_7fb3a6c1b0bc["flatten()"] e30ebf2b_6a1b_e269_3513_9470a916a8d3["extractPropertiesFromApplication()"] e30ebf2b_6a1b_e269_3513_9470a916a8d3 -->|calls| 93112add_a711_264e_9059_7fb3a6c1b0bc e9307381_4736_21cf_8c72_428b6c32a224["extractPropertiesFromServices()"] e9307381_4736_21cf_8c72_428b6c32a224 -->|calls| 93112add_a711_264e_9059_7fb3a6c1b0bc d45906ff_6582_5a8f_fd6e_55187a36cc87["getPropertyName()"] 93112add_a711_264e_9059_7fb3a6c1b0bc -->|calls| d45906ff_6582_5a8f_fd6e_55187a36cc87 style 93112add_a711_264e_9059_7fb3a6c1b0bc fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
core/spring-boot/src/main/java/org/springframework/boot/cloud/CloudFoundryVcapEnvironmentPostProcessor.java lines 193–220
@SuppressWarnings("unchecked")
private void flatten(Properties properties, Map<String, Object> input, @Nullable String path) {
input.forEach((key, value) -> {
String name = getPropertyName(path, key);
if (value instanceof Map) {
// Need a compound key
flatten(properties, (Map<String, Object>) value, name);
}
else if (value instanceof Collection<?> collection) {
// Need a compound key
properties.put(name, StringUtils.collectionToCommaDelimitedString(collection));
int count = 0;
for (Object item : collection) {
String itemKey = "[" + (count++) + "]";
flatten(properties, Collections.singletonMap(itemKey, item), name);
}
}
else if (value instanceof String) {
properties.put(name, value);
}
else if (value instanceof Number || value instanceof Boolean) {
properties.put(name, value.toString());
}
else {
properties.put(name, (value != null) ? value : "");
}
});
}
Domain
Subdomains
Calls
- getPropertyName()
Called By
- extractPropertiesFromApplication()
- extractPropertiesFromServices()
Source
Frequently Asked Questions
What does flatten() do?
flatten() is a function in the spring-boot codebase.
What does flatten() call?
flatten() calls 1 function(s): getPropertyName.
What calls flatten()?
flatten() is called by 2 function(s): extractPropertiesFromApplication, extractPropertiesFromServices.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free