Class GradlePluginContainer
java.lang.Object
io.spring.initializr.generator.buildsystem.gradle.GradlePluginContainer
A container for gradle plugins.
- Author:
- HaiTao Zhang
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add aGradlePlugin
to the standardplugins
block with the specified id.void
add
(String id, Consumer<StandardGradlePlugin> plugin) Add aGradlePlugin
to the standardplugins
block with the specified id andConsumer
to customize the object.void
Apply aGradlePlugin
with the specified id.boolean
Specify if this container has a plugin with the specified id.boolean
isEmpty()
Specify if this container is empty.boolean
Remove the plugin with the specifiedid
.values()
Returns aStream
of registeredGradlePlugin
s.
-
Constructor Details
-
GradlePluginContainer
public GradlePluginContainer()
-
-
Method Details
-
isEmpty
public boolean isEmpty()Specify if this container is empty.- Returns:
true
if noGradlePlugin
is added
-
has
Specify if this container has a plugin with the specified id.- Parameters:
id
- the identifier of a gradle plugin- Returns:
true
if a plugin with the specifiedid
exists
-
values
Returns aStream
of registeredGradlePlugin
s.- Returns:
- a stream of
GradlePlugin
s
-
add
Add aGradlePlugin
to the standardplugins
block with the specified id. Does nothing if the plugin has already been added.- Parameters:
id
- the id of the plugin- See Also:
-
add
Add aGradlePlugin
to the standardplugins
block with the specified id andConsumer
to customize the object. If the plugin has already been added, the consumer can be used to further tune the existing plugin configuration.- Parameters:
id
- the id of the pluginplugin
- aConsumer
to customize theGradlePlugin
-
apply
Apply aGradlePlugin
with the specified id. Does nothing if the plugin has already been applied.- Parameters:
id
- the id of the plugin
-
remove
Remove the plugin with the specifiedid
.- Parameters:
id
- the id of the plugin to remove- Returns:
true
if such a plugin was registered,false
otherwise
-