Package io.spring.initializr.metadata
Class InitializrMetadataBuilder
java.lang.Object
io.spring.initializr.metadata.InitializrMetadataBuilder
Builder for
InitializrMetadata
. Allows to read metadata from any arbitrary
resource, including remote URLs.- Author:
- Stephane Nicoll
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
applyDefaults
(InitializrMetadata metadata) Apply defaults to capabilities that have no value.build()
Build aInitializrMetadata
based on the state of this builder.static InitializrMetadataBuilder
create()
Create an empty builder instance with a defaultInitializrConfiguration
.protected InitializrMetadata
createInstance
(InitializrConfiguration configuration) Creates an empty instance based on the specifiedInitializrConfiguration
.static InitializrMetadataBuilder
fromInitializrProperties
(InitializrProperties configuration) Create a builder instance from the specifiedInitializrProperties
.withCustomizer
(InitializrMetadataCustomizer customizer) Add aInitializrMetadataCustomizer
.withInitializrMetadata
(org.springframework.core.io.Resource resource) Add aInitializrMetadata
to be merged with other content.withInitializrProperties
(InitializrProperties properties) Add aInitializrProperties
to be merged with other content.withInitializrProperties
(InitializrProperties properties, boolean mergeConfiguration) Add aInitializrProperties
to be merged with other content.
-
Method Details
-
withInitializrProperties
Add aInitializrProperties
to be merged with other content. Merges the settings only and not the configuration.- Parameters:
properties
- the properties to use- Returns:
- this instance
- See Also:
-
withInitializrProperties
public InitializrMetadataBuilder withInitializrProperties(InitializrProperties properties, boolean mergeConfiguration) Add aInitializrProperties
to be merged with other content.- Parameters:
properties
- the settings to merge onto this instancemergeConfiguration
- specify if service configuration should be merged as well- Returns:
- this instance
-
withInitializrMetadata
public InitializrMetadataBuilder withInitializrMetadata(org.springframework.core.io.Resource resource) Add aInitializrMetadata
to be merged with other content.- Parameters:
resource
- a resource to a json document describing the metadata to include- Returns:
- this instance
-
withCustomizer
Add aInitializrMetadataCustomizer
. customizers are invoked in their order of addition.- Parameters:
customizer
- the customizer to add- Returns:
- this instance
- See Also:
-
build
Build aInitializrMetadata
based on the state of this builder.- Returns:
- a new
InitializrMetadata
instance
-
createInstance
Creates an empty instance based on the specifiedInitializrConfiguration
.- Parameters:
configuration
- the configuration- Returns:
- a new
InitializrMetadata
instance
-
applyDefaults
Apply defaults to capabilities that have no value.- Parameters:
metadata
- the initializr metadata
-
fromInitializrProperties
public static InitializrMetadataBuilder fromInitializrProperties(InitializrProperties configuration) Create a builder instance from the specifiedInitializrProperties
. Initialize the configuration to use.- Parameters:
configuration
- the configuration to use- Returns:
- a new
InitializrMetadataBuilder
instance - See Also:
-
create
Create an empty builder instance with a defaultInitializrConfiguration
.- Returns:
- a new
InitializrMetadataBuilder
instance
-