Class GradleExtension.Builder

java.lang.Object
io.spring.initializr.generator.buildsystem.gradle.GradleExtension.Builder
Enclosing class:
GradleExtension

public static class GradleExtension.Builder extends Object
A builder for GradleExtension.
  • Constructor Details

    • Builder

      protected Builder(String name)
  • Method Details

    • importType

      public void importType(String type)
      Import a given type.
      Parameters:
      type - the type to import
    • attribute

      public void attribute(String target, String value)
      Set a extension attribute.
      Parameters:
      target - the name of the attribute
      value - the value
    • attributeWithType

      public void attributeWithType(String target, String value, String type)
      Set an extension attribute with a type.
      Parameters:
      target - the name of the attribute
      value - the value
      type - the type to import
    • append

      public void append(String target, String value)
      Configure an extension attribute by appending the specified value.
      Parameters:
      target - the name of the attribute
      value - the value to append
    • appendWithType

      public void appendWithType(String target, String value, String type)
      Configure an extension attribute by appending the specified value and type.
      Parameters:
      target - the name of the attribute
      value - the value to append
      type - the type to import
    • invoke

      public void invoke(String target, String... arguments)
      Invoke an extension method.
      Parameters:
      target - the name of the method
      arguments - the arguments
    • invoke

      public void invoke(String target, Collection<String> arguments)
      Invoke an extension method.
      Parameters:
      target - the name of the method
      arguments - the arguments
    • invokeWithType

      public void invokeWithType(String target, String type, String... arguments)
      Invoke an extension method.
      Parameters:
      target - the name of the method
      type - the type to import
      arguments - the arguments
    • invokeWithType

      public void invokeWithType(String target, String type, Collection<String> arguments)
      Invoke an extension method.
      Parameters:
      target - the name of the method
      type - the type to import
      arguments - the arguments
    • nested

      public void nested(String name, Consumer<GradleExtension.Builder> customizer)
      Customize a nested extension for the specified name. If such nested extension has already been added, the consumer can be used to further tune the existing extension configuration.
      Parameters:
      name - a extension name
      customizer - a Consumer to customize the nested extension
    • build

      public GradleExtension build()
      Build a GradleExtension with the current state of this builder.
      Returns:
      a GradleExtension