Home / Class/ Difference Class — spring-boot Architecture

Difference Class — spring-boot Architecture

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

Entity Profile

Relationship Graph

Source Code

configuration-metadata/spring-boot-configuration-metadata-changelog-generator/src/main/java/org/springframework/boot/configurationmetadata/changelog/Difference.java lines 34–60

record Difference(DifferenceType type, ConfigurationMetadataProperty oldProperty,
		ConfigurationMetadataProperty newProperty) {

	static Difference compute(ConfigurationMetadataProperty oldProperty, ConfigurationMetadataProperty newProperty) {
		if (newProperty == null) {
			if (!(oldProperty.isDeprecated() && oldProperty.getDeprecation().getLevel() == Level.ERROR)) {
				return new Difference(DifferenceType.DELETED, oldProperty, null);
			}
			return null;
		}
		if (newProperty.isDeprecated() && !oldProperty.isDeprecated()) {
			Level level = newProperty.getDeprecation().getLevel();
			DifferenceType differenceType = (level == Level.WARNING) ? DifferenceType.DEPRECATED
					: DifferenceType.DELETED;
			return new Difference(differenceType, oldProperty, newProperty);
		}
		if (oldProperty.isDeprecated() && oldProperty.getDeprecation().getLevel() == Level.WARNING
				&& newProperty.isDeprecated() && newProperty.getDeprecation().getLevel() == Level.ERROR) {
			return new Difference(DifferenceType.DELETED, oldProperty, newProperty);
		}
		if (!Objects.equals(oldProperty.getDefaultValue(), newProperty.getDefaultValue())) {
			return new Difference(DifferenceType.DEFAULT_CHANGED, oldProperty, newProperty);
		}
		return null;
	}

}

Domain

Analyze Your Own Codebase

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

Try Supermodel Free