Class GradleSnippetContainer

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

public class GradleSnippetContainer extends Object
A container for Gradle snippets.
Author:
Stephane Nicoll
  • Constructor Details

    • GradleSnippetContainer

      public GradleSnippetContainer()
  • Method Details

    • isEmpty

      public boolean isEmpty()
      Specify if this container is empty.
      Returns:
      true if no snippet is registered
    • values

      public Stream<GradleSnippet> values()
      Return the Gradle snippets to apply.
      Returns:
      the gradle snippets
    • importedTypes

      public Stream<String> importedTypes()
      Return the fully qualified name of types to import.
      Returns:
      the imported types
    • add

      public void add(Set<String> importedTypes, Consumer<IndentingWriter> writer)
      Register a snippet with the specified types to import and writer.
      Parameters:
      importedTypes - the types to import
      writer - the writer to use.
    • add

      public void add(Consumer<IndentingWriter> writer)
      Register a snippet with no import.
      Parameters:
      writer - the writer to use.