Class ComposeServiceContainer

java.lang.Object
io.spring.initializr.generator.container.docker.compose.ComposeServiceContainer

public class ComposeServiceContainer extends Object
A container for Docker Compose services.
Author:
Stephane Nicoll
  • Constructor Details

    • ComposeServiceContainer

      public ComposeServiceContainer()
  • Method Details

    • isEmpty

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

      public boolean has(String name)
      Specify if this container has a service customization with the specified name.
      Parameters:
      name - the name of a service
      Returns:
      true if a customization for a service with the specified name exists
    • values

      public Stream<ComposeService> values()
      Return the services to customize.
      Returns:
      the compose services
    • add

      public void add(String name, Consumer<ComposeService.Builder> service)
      Add a ComposeService with the specified name and Consumer to customize the object. If the service has already been added, the consumer can be used to further tune the existing service configuration.
      Parameters:
      name - the name of the service
      service - a Consumer to customize the ComposeService
    • remove

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