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 TypeMethodDescriptionvoid
Register aconfiguration
with the specified name.Return the configuration that should be customized.void
customize
(String name, Consumer<GradleConfiguration.Builder> configuration) Customize an existingconfiguration
with the specifiedname
.boolean
Specify if this container has a configuration with the specifiedname
.boolean
isEmpty()
Specify if this container is empty.names()
Return the configuration names that should be registered.boolean
Remove the configuration with the specifiedname
.
-
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
Specify if this container has a configuration with the specifiedname
.- Parameters:
name
- the name of a configuration- Returns:
true
if a configuration with the specifiedname
exists
-
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 aconfiguration
with the specified name.- Parameters:
name
- the name of a configuration
-
customize
Customize an existingconfiguration
with 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
- aConsumer
to customize theGradleConfiguration
-
remove
Remove the configuration with the specifiedname
.- Parameters:
name
- the name of a configuration to register or customization- Returns:
true
if such a configuration was registered,false
otherwise
-