Class ComposeServiceContainer
java.lang.Object
io.spring.initializr.generator.container.docker.compose.ComposeServiceContainer
A container for Docker Compose services.
- Author:
- Stephane Nicoll
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(String name, Consumer<ComposeService.Builder> service) Add aComposeService
with the specified name andConsumer
to customize the object.boolean
Specify if this container has a service customization with the specifiedname
.boolean
isEmpty()
Specify if this container is empty.boolean
Remove the service with the specifiedname
.values()
Return theservices
to customize.
-
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
Specify if this container has a service customization with the specifiedname
.- Parameters:
name
- the name of a service- Returns:
true
if a customization for a service with the specifiedname
exists
-
values
Return theservices
to customize.- Returns:
- the compose services
-
add
Add aComposeService
with the specified name andConsumer
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 serviceservice
- aConsumer
to customize theComposeService
-
remove
Remove the service with the specifiedname
.- Parameters:
name
- the name of the service- Returns:
true
if such a service was registered,false
otherwise
-