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

mergeExistingPropertyWithSeveralCandidates() — spring-boot Function Reference

Architecture documentation for the mergeExistingPropertyWithSeveralCandidates() function in MergeMetadataGenerationTests.java from the spring-boot codebase.

Entity Profile

Dependency Diagram

graph TD
  8b20b6cb_c08f_f4ce_f63a_83f47564f46f["mergeExistingPropertyWithSeveralCandidates()"]
  14d469eb_4ba7_e784_b4d8_11c5e9d3b187["newProperty()"]
  8b20b6cb_c08f_f4ce_f63a_83f47564f46f -->|calls| 14d469eb_4ba7_e784_b4d8_11c5e9d3b187
  a0b89884_7c7a_0fc8_975b_346d0a11f1b4["buildAdditionalMetadata()"]
  8b20b6cb_c08f_f4ce_f63a_83f47564f46f -->|calls| a0b89884_7c7a_0fc8_975b_346d0a11f1b4
  c8c9e7f6_e856_4711_6fe7_b1c2aeb3d239["getItems()"]
  8b20b6cb_c08f_f4ce_f63a_83f47564f46f -->|calls| c8c9e7f6_e856_4711_6fe7_b1c2aeb3d239
  c837e11c_a2cc_cf90_018d_1ecafff750c5["getType()"]
  8b20b6cb_c08f_f4ce_f63a_83f47564f46f -->|calls| c837e11c_a2cc_cf90_018d_1ecafff750c5
  e679b8c3_1d8d_f2a3_e26c_19ffb5ad64b1["getDefaultValue()"]
  8b20b6cb_c08f_f4ce_f63a_83f47564f46f -->|calls| e679b8c3_1d8d_f2a3_e26c_19ffb5ad64b1
  91772c88_8487_b65b_7842_fb8961e64bd0["getSourceType()"]
  8b20b6cb_c08f_f4ce_f63a_83f47564f46f -->|calls| 91772c88_8487_b65b_7842_fb8961e64bd0
  1cc7c979_ec39_712f_d236_60cb24ffe143["getDescription()"]
  8b20b6cb_c08f_f4ce_f63a_83f47564f46f -->|calls| 1cc7c979_ec39_712f_d236_60cb24ffe143
  f26deba5_4534_21f4_e7df_a2d2684b557b["isNull()"]
  8b20b6cb_c08f_f4ce_f63a_83f47564f46f -->|calls| f26deba5_4534_21f4_e7df_a2d2684b557b
  2f92313c_75ed_baa9_94c7_81e700548c9a["equals()"]
  8b20b6cb_c08f_f4ce_f63a_83f47564f46f -->|calls| 2f92313c_75ed_baa9_94c7_81e700548c9a
  e8e90934_397b_b72b_06c2_bff3d0ed5ac5["getName()"]
  8b20b6cb_c08f_f4ce_f63a_83f47564f46f -->|calls| e8e90934_397b_b72b_06c2_bff3d0ed5ac5
  style 8b20b6cb_c08f_f4ce_f63a_83f47564f46f fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

configuration-metadata/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationprocessor/MergeMetadataGenerationTests.java lines 82–111

	@Test
	void mergeExistingPropertyWithSeveralCandidates() throws Exception {
		ItemMetadata property = ItemMetadata.newProperty("simple", "flag", Boolean.class.getName(), null, null, null,
				true, null);
		String additionalMetadata = buildAdditionalMetadata(property);
		ConfigurationMetadata metadata = compile(additionalMetadata, SimpleProperties.class,
				SimpleConflictingProperties.class);
		assertThat(metadata.getItems()).hasSize(6);
		List<ItemMetadata> items = metadata.getItems()
			.stream()
			.filter((item) -> item.getName().equals("simple.flag"))
			.toList();
		assertThat(items).hasSize(2);
		ItemMetadata matchingProperty = items.stream()
			.filter((item) -> item.getType().equals(Boolean.class.getName()))
			.findFirst()
			.orElse(null);
		assertThat(matchingProperty).isNotNull();
		assertThat(matchingProperty.getDefaultValue()).isEqualTo(true);
		assertThat(matchingProperty.getSourceType()).isEqualTo(SimpleProperties.class.getName());
		assertThat(matchingProperty.getDescription()).isEqualTo("A simple flag.");
		ItemMetadata nonMatchingProperty = items.stream()
			.filter((item) -> item.getType().equals(String.class.getName()))
			.findFirst()
			.orElse(null);
		assertThat(nonMatchingProperty).isNotNull();
		assertThat(nonMatchingProperty.getDefaultValue()).isEqualTo("hello");
		assertThat(nonMatchingProperty.getSourceType()).isEqualTo(SimpleConflictingProperties.class.getName());
		assertThat(nonMatchingProperty.getDescription()).isNull();
	}

Domain

Subdomains

Frequently Asked Questions

What does mergeExistingPropertyWithSeveralCandidates() do?
mergeExistingPropertyWithSeveralCandidates() is a function in the spring-boot codebase.
What does mergeExistingPropertyWithSeveralCandidates() call?
mergeExistingPropertyWithSeveralCandidates() calls 10 function(s): buildAdditionalMetadata, equals, getDefaultValue, getDescription, getItems, getName, getSourceType, getType, and 2 more.

Analyze Your Own Codebase

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

Try Supermodel Free