Class MavenResourceContainer
java.lang.Object
io.spring.initializr.generator.buildsystem.maven.MavenResourceContainer
A container for
MavenResource
s.- Author:
- Stephane Nicoll
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a resource with default settings for the specifieddirectory
.void
add
(String directory, Consumer<MavenResource.Builder> resource) Add a resource with default settings for the specifieddirectory
andConsumer
to customize the resource.boolean
Specify if this container has a resource the specifieddirectory
.boolean
isEmpty()
Specify if this container is empty.boolean
Remove the resource with the specifieddirectory
.values()
Returns aStream
of registeredMavenResource
s.
-
Constructor Details
-
MavenResourceContainer
public MavenResourceContainer()
-
-
Method Details
-
isEmpty
public boolean isEmpty()Specify if this container is empty.- Returns:
true
if noMavenResource
is added
-
has
Specify if this container has a resource the specifieddirectory
.- Parameters:
directory
- the resource directory- Returns:
true
if an item for the specifieddirectory
exists
-
values
Returns aStream
of registeredMavenResource
s.- Returns:
- a stream of
MavenResource
s
-
add
Add a resource with default settings for the specifieddirectory
.- Parameters:
directory
- the directory to add
-
add
Add a resource with default settings for the specifieddirectory
andConsumer
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 addresource
- aConsumer
to customize theMavenResource
-
remove
Remove the resource with the specifieddirectory
.- Parameters:
directory
- the directory to remove- Returns:
true
if such a resource was registered,false
otherwise
-