Class MavenResourceContainer

java.lang.Object
io.spring.initializr.generator.buildsystem.maven.MavenResourceContainer

public class MavenResourceContainer extends Object
A container for MavenResources.
Author:
Stephane Nicoll
  • Constructor Details

    • MavenResourceContainer

      public MavenResourceContainer()
  • Method Details

    • isEmpty

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

      public boolean has(String directory)
      Specify if this container has a resource the specified directory.
      Parameters:
      directory - the resource directory
      Returns:
      true if an item for the specified directory exists
    • values

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

      public void add(String directory)
      Add a resource with default settings for the specified directory.
      Parameters:
      directory - the directory to add
    • add

      public void add(String directory, Consumer<MavenResource.Builder> resource)
      Add a resource with default settings for the specified directory and Consumer to customize the resource. If the resource has already been added, the consumer can be used to further tune the existing resource configuration.
      Parameters:
      directory - the directory to add
      resource - a Consumer to customize the MavenResource
    • remove

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