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 aProjectDescriptionDiff
that uses a copy of the specified description as its source. -
Method Summary
Modifier and TypeMethodDescriptionReturn the originalProjectDescription
that is being tracked.void
ifApplicationNameChanged
(ProjectDescription current, BiConsumer<String, String> consumer) Calls the specified consumer if theapplicationName
is different on the original source project description than the specified project description.void
ifArtifactIdChanged
(ProjectDescription current, BiConsumer<String, String> consumer) Calls the specified consumer if theartifactId
is different on the original source project description than the specified project description.void
ifBaseDirectoryChanged
(ProjectDescription current, BiConsumer<String, String> consumer) Calls the specified consumer if thebaseDirectory
is different on the original source project description than the specified project description.void
ifBuildSystemChanged
(ProjectDescription current, BiConsumer<BuildSystem, BuildSystem> consumer) Calls the specified consumer if thebuildSystem
is different on the original source project description than the specified project description.void
ifDescriptionChanged
(ProjectDescription current, BiConsumer<String, String> consumer) Calls the specified consumer if thedescription
is different on the original source project description than the specified project description.void
ifGroupIdChanged
(ProjectDescription current, BiConsumer<String, String> consumer) Calls the specified consumer if thegroupId
is different on the original source project description than the specified project description.void
ifLanguageChanged
(ProjectDescription current, BiConsumer<Language, Language> consumer) Calls the specified consumer if thelanguage
is different on the original source project description than the specified project description.void
ifNameChanged
(ProjectDescription current, BiConsumer<String, String> consumer) Calls the specified consumer if thename
is different on the original source project description than the specified project description.void
ifPackageNameChanged
(ProjectDescription current, BiConsumer<String, String> consumer) Calls the specified consumer if thepackageName
is different on the original source project description than the specified project description.void
ifPackagingChanged
(ProjectDescription current, BiConsumer<Packaging, Packaging> consumer) Calls the specified consumer if thepackaging
is different on the original source project description than the specified project description.void
ifPlatformVersionChanged
(ProjectDescription current, BiConsumer<Version, Version> consumer) Calls the specified consumer if theplatformVersion
is different on the original source project description than the specified project description.void
ifVersionChanged
(ProjectDescription current, BiConsumer<String, String> consumer) Calls the specified consumer if theversion
is different on the original source project description than the specified project description.
-
Constructor Details
-
ProjectDescriptionDiff
Create aProjectDescriptionDiff
that uses a copy of the specified description as its source.- Parameters:
original
- the description to copy as the source
-
-
Method Details
-
getOriginal
Return the originalProjectDescription
that is being tracked.- Returns:
- the original description
-
ifPlatformVersionChanged
public void ifPlatformVersionChanged(ProjectDescription current, BiConsumer<Version, Version> consumer) Calls the specified consumer if theplatformVersion
is 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 thebuildSystem
is 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 thepackaging
is 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 thelanguage
is 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 thegroupId
is 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 theartifactId
is 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 theversion
is 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 thename
is 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 thedescription
is 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 theapplicationName
is 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 thepackageName
is 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 thebaseDirectory
is 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
-