Class GradleConfigurationContainer

java.lang.Object
io.spring.initializr.generator.buildsystem.gradle.GradleConfigurationContainer

public class GradleConfigurationContainer extends Object
A container for custom configuration and configuration customizations.
Author:
Stephane Nicoll
  • Constructor Details

    • GradleConfigurationContainer

      public GradleConfigurationContainer()
  • Method Details

    • isEmpty

      public boolean isEmpty()
      Specify if this container is empty.
      Returns:
      true if no custom configuration is registered or no configuration is customized
    • has

      public boolean has(String name)
      Specify if this container has a configuration with the specified name.
      Parameters:
      name - the name of a configuration
      Returns:
      true if a configuration with the specified name exists
    • names

      public Stream<String> names()
      Return the configuration names that should be registered.
      Returns:
      the configuration names
    • customizations

      public Stream<GradleConfiguration> customizations()
      Return the configuration that should be customized.
      Returns:
      the configuration customizations
    • add

      public void add(String name)
      Register a configuration with the specified name.
      Parameters:
      name - the name of a configuration
    • customize

      public void customize(String name, Consumer<GradleConfiguration.Builder> configuration)
      Customize an existing configuration with the specified name. If the configuration has already been customized, the consumer can be used to further tune the existing configuration customization.
      Parameters:
      name - the name of the configuration to customize
      configuration - a Consumer to customize the GradleConfiguration
    • remove

      public boolean remove(String name)
      Remove the configuration with the specified name.
      Parameters:
      name - the name of a configuration to register or customization
      Returns:
      true if such a configuration was registered, false otherwise