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

merge() — spring-boot Function Reference

Architecture documentation for the merge() function in CollectionBinder.java from the spring-boot codebase.

Entity Profile

Dependency Diagram

graph TD
  37c59724_9e93_90eb_1fd5_2da7238d6f19["merge()"]
  ca5c5f5b_c20f_18af_c014_ff6f4c1e88c3["getExistingIfPossible()"]
  37c59724_9e93_90eb_1fd5_2da7238d6f19 -->|calls| ca5c5f5b_c20f_18af_c014_ff6f4c1e88c3
  a583102c_d818_2fc8_c333_ca3724bae6d6["copyIfPossible()"]
  37c59724_9e93_90eb_1fd5_2da7238d6f19 -->|calls| a583102c_d818_2fc8_c333_ca3724bae6d6
  8b89a270_a9eb_a626_8599_a73f61510584["createNewCollection()"]
  37c59724_9e93_90eb_1fd5_2da7238d6f19 -->|calls| 8b89a270_a9eb_a626_8599_a73f61510584
  style 37c59724_9e93_90eb_1fd5_2da7238d6f19 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

core/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/CollectionBinder.java lines 57–71

	@Override
	protected Collection<Object> merge(Supplier<Collection<Object>> existing, Collection<Object> additional) {
		Collection<Object> existingCollection = getExistingIfPossible(existing);
		if (existingCollection == null) {
			return additional;
		}
		try {
			existingCollection.clear();
			existingCollection.addAll(additional);
			return copyIfPossible(existingCollection);
		}
		catch (UnsupportedOperationException ex) {
			return createNewCollection(additional);
		}
	}

Domain

Subdomains

Calls

  • copyIfPossible()
  • createNewCollection()
  • getExistingIfPossible()

Frequently Asked Questions

What does merge() do?
merge() is a function in the spring-boot codebase.
What does merge() call?
merge() calls 3 function(s): copyIfPossible, createNewCollection, getExistingIfPossible.

Analyze Your Own Codebase

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

Try Supermodel Free