Class ProjectDescriptionDiff

java.lang.Object
io.spring.initializr.generator.project.ProjectDescriptionDiff

public class ProjectDescriptionDiff extends Object
Provides a convenient API for determining if certain fields on a ProjectDescription were modified.
Author:
Chris Bono, Stephane Nicoll
  • Constructor Details

    • ProjectDescriptionDiff

      public ProjectDescriptionDiff(ProjectDescription original)
      Create a ProjectDescriptionDiff that uses a copy of the specified description as its source.
      Parameters:
      original - the description to copy as the source
  • Method Details

    • getOriginal

      public ProjectDescription getOriginal()
      Return the original ProjectDescription that is being tracked.
      Returns:
      the original description
    • ifPlatformVersionChanged

      public void ifPlatformVersionChanged(ProjectDescription current, BiConsumer<Version,Version> consumer)
      Calls the specified consumer if the platformVersion is different on the original source project description than the specified project description.
      Parameters:
      current - the project description to test against
      consumer - to call if the property has changed
    • ifBuildSystemChanged

      public void ifBuildSystemChanged(ProjectDescription current, BiConsumer<BuildSystem,BuildSystem> consumer)
      Calls the specified consumer if the buildSystem is different on the original source project description than the specified project description.
      Parameters:
      current - the description to test against
      consumer - to call if the property has changed
    • ifPackagingChanged

      public void ifPackagingChanged(ProjectDescription current, BiConsumer<Packaging,Packaging> consumer)
      Calls the specified consumer if the packaging is different on the original source project description than the specified project description.
      Parameters:
      current - the description to test against
      consumer - to call if the property has changed
    • ifLanguageChanged

      public void ifLanguageChanged(ProjectDescription current, BiConsumer<Language,Language> consumer)
      Calls the specified consumer if the language is different on the original source project description than the specified project description.
      Parameters:
      current - the description to test against
      consumer - to call if the property has changed
    • ifGroupIdChanged

      public void ifGroupIdChanged(ProjectDescription current, BiConsumer<String,String> consumer)
      Calls the specified consumer if the groupId is different on the original source project description than the specified project description.
      Parameters:
      current - the description to test against
      consumer - to call if the property has changed
    • ifArtifactIdChanged

      public void ifArtifactIdChanged(ProjectDescription current, BiConsumer<String,String> consumer)
      Calls the specified consumer if the artifactId is different on the original source project description than the specified project description.
      Parameters:
      current - the description to test against
      consumer - to call if the property has changed
    • ifVersionChanged

      public void ifVersionChanged(ProjectDescription current, BiConsumer<String,String> consumer)
      Calls the specified consumer if the version is different on the original source project description than the specified project description.
      Parameters:
      current - the description to test against
      consumer - to call if the property has changed
    • ifNameChanged

      public void ifNameChanged(ProjectDescription current, BiConsumer<String,String> consumer)
      Calls the specified consumer if the name is different on the original source project description than the specified project description.
      Parameters:
      current - the description to test against
      consumer - to call if the property has changed
    • ifDescriptionChanged

      public void ifDescriptionChanged(ProjectDescription current, BiConsumer<String,String> consumer)
      Calls the specified consumer if the description is different on the original source project description than the specified project description.
      Parameters:
      current - the description to test against
      consumer - to call if the property has changed
    • ifApplicationNameChanged

      public void ifApplicationNameChanged(ProjectDescription current, BiConsumer<String,String> consumer)
      Calls the specified consumer if the applicationName is different on the original source project description than the specified project description.
      Parameters:
      current - the description to test against
      consumer - to call if the property has changed
    • ifPackageNameChanged

      public void ifPackageNameChanged(ProjectDescription current, BiConsumer<String,String> consumer)
      Calls the specified consumer if the packageName is different on the original source project description than the specified project description.
      Parameters:
      current - the description to test against
      consumer - to call if the property has changed
    • ifBaseDirectoryChanged

      public void ifBaseDirectoryChanged(ProjectDescription current, BiConsumer<String,String> consumer)
      Calls the specified consumer if the baseDirectory is different on the original source project description than the specified project description.
      Parameters:
      current - the description to test against
      consumer - to call if the property has changed