Home / Class/ TestPropertyMapper Class — spring-boot Architecture

TestPropertyMapper Class — spring-boot Architecture

Architecture documentation for the TestPropertyMapper class in TestPropertyMapper.java from the spring-boot codebase.

Entity Profile

Source Code

core/spring-boot/src/test/java/org/springframework/boot/context/properties/source/TestPropertyMapper.java lines 30–56

class TestPropertyMapper implements PropertyMapper {

	private final MultiValueMap<ConfigurationPropertyName, String> fromConfig = new LinkedMultiValueMap<>();

	private final Map<String, ConfigurationPropertyName> fromSource = new LinkedHashMap<>();

	void addFromPropertySource(String from, String to) {
		this.fromSource.put(from, ConfigurationPropertyName.of(to));
	}

	void addFromConfigurationProperty(ConfigurationPropertyName from, String... to) {
		for (String propertySourceName : to) {
			this.fromConfig.add(from, propertySourceName);
		}
	}

	@Override
	public List<String> map(ConfigurationPropertyName configurationPropertyName) {
		return this.fromConfig.getOrDefault(configurationPropertyName, Collections.emptyList());
	}

	@Override
	public ConfigurationPropertyName map(String propertySourceName) {
		return this.fromSource.getOrDefault(propertySourceName, ConfigurationPropertyName.EMPTY);
	}

}

Analyze Your Own Codebase

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

Try Supermodel Free