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 voidapplyDefaults(InitializrMetadata metadata) Apply defaults to capabilities that have no value.build()Build aInitializrMetadatabased on the state of this builder.static InitializrMetadataBuildercreate()Create an empty builder instance with a defaultInitializrConfiguration.protected InitializrMetadatacreateInstance(InitializrConfiguration configuration) Creates an empty instance based on the specifiedInitializrConfiguration.static InitializrMetadataBuilderfromInitializrProperties(InitializrProperties configuration) Create a builder instance from the specifiedInitializrProperties.withCustomizer(InitializrMetadataCustomizer customizer) Add aInitializrMetadataCustomizer.withInitializrMetadata(org.springframework.core.io.Resource resource) Add aInitializrMetadatato be merged with other content.withInitializrProperties(InitializrProperties properties) Add aInitializrPropertiesto be merged with other content.withInitializrProperties(InitializrProperties properties, boolean mergeConfiguration) Add aInitializrPropertiesto be merged with other content.
-
Method Details
-
withInitializrProperties
Add aInitializrPropertiesto 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 aInitializrPropertiesto 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 aInitializrMetadatato 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 aInitializrMetadatabased on the state of this builder.- Returns:
- a new
InitializrMetadatainstance
-
createInstance
Creates an empty instance based on the specifiedInitializrConfiguration.- Parameters:
configuration- the configuration- Returns:
- a new
InitializrMetadatainstance
-
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
InitializrMetadataBuilderinstance - See Also:
-
create
Create an empty builder instance with a defaultInitializrConfiguration.- Returns:
- a new
InitializrMetadataBuilderinstance
-