Class GradlePluginContainer

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

public class GradlePluginContainer extends Object
A container for gradle plugins.
Author:
HaiTao Zhang
  • Constructor Details

    • GradlePluginContainer

      public GradlePluginContainer()
  • Method Details

    • isEmpty

      public boolean isEmpty()
      Specify if this container is empty.
      Returns:
      true if no GradlePlugin is added
    • has

      public boolean has(String id)
      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 specified id exists
    • values

      public Stream<GradlePlugin> values()
      Returns a Stream of registered GradlePlugins.
      Returns:
      a stream of GradlePlugins
    • add

      public void add(String id)
      Add a GradlePlugin to the standard plugins block with the specified id. Does nothing if the plugin has already been added.
      Parameters:
      id - the id of the plugin
      See Also:
    • add

      public void add(String id, Consumer<StandardGradlePlugin> plugin)
      Add a GradlePlugin to the standard plugins block with the specified id and Consumer 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 plugin
      plugin - a Consumer to customize the GradlePlugin
    • apply

      public void apply(String id)
      Apply a GradlePlugin with the specified id. Does nothing if the plugin has already been applied.
      Parameters:
      id - the id of the plugin
    • remove

      public boolean remove(String id)
      Remove the plugin with the specified id.
      Parameters:
      id - the id of the plugin to remove
      Returns:
      true if such a plugin was registered, false otherwise