Class MavenExtensionContainer
java.lang.Object
io.spring.initializr.generator.buildsystem.maven.MavenExtensionContainer
A container for
maven extensions
.- Author:
- Niklas Herder, Stephane Nicoll
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
add
(String groupId, String artifactId, Consumer<MavenExtension.Builder> extension) Add aMavenExtension
with the specifiedgroupId
andartifactId
andConsumer
to customize the extension.boolean
Specify if this container has a extension with the specifiedgroupId
andartifactId
.boolean
isEmpty()
Specify if this container is empty.boolean
Remove the extension with the specifiedgroupId
andartifactId
.values()
Returns aStream
of registeredMavenExtension
s.
-
Constructor Details
-
MavenExtensionContainer
public MavenExtensionContainer()
-
-
Method Details
-
isEmpty
public boolean isEmpty()Specify if this container is empty.- Returns:
true
if noMavenExtension
is added
-
has
Specify if this container has a extension with the specifiedgroupId
andartifactId
.- Parameters:
groupId
- the groupId of the extensionartifactId
- the artifactId of the extension- Returns:
true
if an item with the specifiedgroupId
andartifactId
exists
-
values
Returns aStream
of registeredMavenExtension
s.- Returns:
- a stream of
MavenExtension
s
-
add
Add aMavenExtension
with the specifiedgroupId
,artifactId
, andversion
. If the extension has already been added, only update the version if necessary.- Parameters:
groupId
- the groupId of the extensionartifactId
- the artifactId of the extensionversion
- the version of the extension- See Also:
-
add
Add aMavenExtension
with the specifiedgroupId
andartifactId
andConsumer
to customize the extension. If the extension has already been added, the consumer can be used to further tune the existing extension configuration.- Parameters:
groupId
- the groupId of the extensionartifactId
- the artifactId of the extensionextension
- aConsumer
to customize theMavenExtension
-
remove
Remove the extension with the specifiedgroupId
andartifactId
.- Parameters:
groupId
- the groupId of the extension to removeartifactId
- the artifactId of the extension to remove- Returns:
true
if such a extension was registered,false
otherwise
-