Class GradleConfigurationContainer
java.lang.Object
io.spring.initializr.generator.buildsystem.gradle.GradleConfigurationContainer
A container for custom configuration and configuration
customizations.
- Author:
- Stephane Nicoll
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidRegister aconfigurationwith the specified name.Return the configuration that should be customized.voidcustomize(String name, Consumer<GradleConfiguration.Builder> configuration) Customize an existingconfigurationwith the specifiedname.booleanSpecify if this container has a configuration with the specifiedname.booleanisEmpty()Specify if this container is empty.names()Return the configuration names that should be registered.booleanRemove the configuration with the specifiedname.
-
Constructor Details
-
GradleConfigurationContainer
public GradleConfigurationContainer()
-
-
Method Details
-
isEmpty
public boolean isEmpty()Specify if this container is empty.- Returns:
trueif no custom configuration is registered or no configuration is customized
-
has
Specify if this container has a configuration with the specifiedname.- Parameters:
name- the name of a configuration- Returns:
trueif a configuration with the specifiednameexists
-
names
Return the configuration names that should be registered.- Returns:
- the configuration names
-
customizations
Return the configuration that should be customized.- Returns:
- the configuration customizations
-
add
Register aconfigurationwith the specified name.- Parameters:
name- the name of a configuration
-
customize
Customize an existingconfigurationwith the specifiedname. 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 customizeconfiguration- aConsumerto customize theGradleConfiguration
-
remove
Remove the configuration with the specifiedname.- Parameters:
name- the name of a configuration to register or customization- Returns:
trueif such a configuration was registered,falseotherwise
-