Class ProjectDescriptionDiff
java.lang.Object
io.spring.initializr.generator.project.ProjectDescriptionDiff
Provides a convenient API for determining if certain fields on a
ProjectDescription were modified.- Author:
- Chris Bono, Stephane Nicoll
-
Constructor Summary
ConstructorsConstructorDescriptionProjectDescriptionDiff(ProjectDescription original) Create aProjectDescriptionDiffthat uses a copy of the specified description as its source. -
Method Summary
Modifier and TypeMethodDescriptionReturn the originalProjectDescriptionthat is being tracked.voidifApplicationNameChanged(ProjectDescription current, BiConsumer<String, String> consumer) Calls the specified consumer if theapplicationNameis different on the original source project description than the specified project description.voidifArtifactIdChanged(ProjectDescription current, BiConsumer<String, String> consumer) Calls the specified consumer if theartifactIdis different on the original source project description than the specified project description.voidifBaseDirectoryChanged(ProjectDescription current, BiConsumer<String, String> consumer) Calls the specified consumer if thebaseDirectoryis different on the original source project description than the specified project description.voidifBuildSystemChanged(ProjectDescription current, BiConsumer<BuildSystem, BuildSystem> consumer) Calls the specified consumer if thebuildSystemis different on the original source project description than the specified project description.voidifDescriptionChanged(ProjectDescription current, BiConsumer<String, String> consumer) Calls the specified consumer if thedescriptionis different on the original source project description than the specified project description.voidifGroupIdChanged(ProjectDescription current, BiConsumer<String, String> consumer) Calls the specified consumer if thegroupIdis different on the original source project description than the specified project description.voidifLanguageChanged(ProjectDescription current, BiConsumer<Language, Language> consumer) Calls the specified consumer if thelanguageis different on the original source project description than the specified project description.voidifNameChanged(ProjectDescription current, BiConsumer<String, String> consumer) Calls the specified consumer if thenameis different on the original source project description than the specified project description.voidifPackageNameChanged(ProjectDescription current, BiConsumer<String, String> consumer) Calls the specified consumer if thepackageNameis different on the original source project description than the specified project description.voidifPackagingChanged(ProjectDescription current, BiConsumer<Packaging, Packaging> consumer) Calls the specified consumer if thepackagingis different on the original source project description than the specified project description.voidifPlatformVersionChanged(ProjectDescription current, BiConsumer<Version, Version> consumer) Calls the specified consumer if theplatformVersionis different on the original source project description than the specified project description.voidifVersionChanged(ProjectDescription current, BiConsumer<String, String> consumer) Calls the specified consumer if theversionis different on the original source project description than the specified project description.
-
Constructor Details
-
ProjectDescriptionDiff
Create aProjectDescriptionDiffthat uses a copy of the specified description as its source.- Parameters:
original- the description to copy as the source
-
-
Method Details
-
getOriginal
Return the originalProjectDescriptionthat is being tracked.- Returns:
- the original description
-
ifPlatformVersionChanged
public void ifPlatformVersionChanged(ProjectDescription current, BiConsumer<Version, Version> consumer) Calls the specified consumer if theplatformVersionis different on the original source project description than the specified project description.- Parameters:
current- the project description to test againstconsumer- to call if the property has changed
-
ifBuildSystemChanged
public void ifBuildSystemChanged(ProjectDescription current, BiConsumer<BuildSystem, BuildSystem> consumer) Calls the specified consumer if thebuildSystemis different on the original source project description than the specified project description.- Parameters:
current- the description to test againstconsumer- to call if the property has changed
-
ifPackagingChanged
public void ifPackagingChanged(ProjectDescription current, BiConsumer<Packaging, Packaging> consumer) Calls the specified consumer if thepackagingis different on the original source project description than the specified project description.- Parameters:
current- the description to test againstconsumer- to call if the property has changed
-
ifLanguageChanged
Calls the specified consumer if thelanguageis different on the original source project description than the specified project description.- Parameters:
current- the description to test againstconsumer- to call if the property has changed
-
ifGroupIdChanged
Calls the specified consumer if thegroupIdis different on the original source project description than the specified project description.- Parameters:
current- the description to test againstconsumer- to call if the property has changed
-
ifArtifactIdChanged
Calls the specified consumer if theartifactIdis different on the original source project description than the specified project description.- Parameters:
current- the description to test againstconsumer- to call if the property has changed
-
ifVersionChanged
Calls the specified consumer if theversionis different on the original source project description than the specified project description.- Parameters:
current- the description to test againstconsumer- to call if the property has changed
-
ifNameChanged
Calls the specified consumer if thenameis different on the original source project description than the specified project description.- Parameters:
current- the description to test againstconsumer- to call if the property has changed
-
ifDescriptionChanged
Calls the specified consumer if thedescriptionis different on the original source project description than the specified project description.- Parameters:
current- the description to test againstconsumer- to call if the property has changed
-
ifApplicationNameChanged
public void ifApplicationNameChanged(ProjectDescription current, BiConsumer<String, String> consumer) Calls the specified consumer if theapplicationNameis different on the original source project description than the specified project description.- Parameters:
current- the description to test againstconsumer- to call if the property has changed
-
ifPackageNameChanged
Calls the specified consumer if thepackageNameis different on the original source project description than the specified project description.- Parameters:
current- the description to test againstconsumer- to call if the property has changed
-
ifBaseDirectoryChanged
Calls the specified consumer if thebaseDirectoryis different on the original source project description than the specified project description.- Parameters:
current- the description to test againstconsumer- to call if the property has changed
-