Class ConfigurationMetadataRepositoryJsonBuilder
- java.lang.Object
- org.springframework.boot.configurationmetadata.ConfigurationMetadataRepositoryJsonBuilder
public final class ConfigurationMetadataRepositoryJsonBuilder extends Object
Load aConfigurationMetadataRepository
from the content of arbitrary resource(s).- Since:
- 1.3.0
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ConfigurationMetadataRepository
build()
Build aConfigurationMetadataRepository
with the current state of this builder.static ConfigurationMetadataRepositoryJsonBuilder
create()
Create a new builder instance usingStandardCharsets.UTF_8
as the default charset.static ConfigurationMetadataRepositoryJsonBuilder
create(InputStream... inputStreams)
Create a new builder instance usingStandardCharsets.UTF_8
as the default charset and the specified json resource.static ConfigurationMetadataRepositoryJsonBuilder
create(Charset defaultCharset)
Create a new builder instance using the specified defaultCharset
.ConfigurationMetadataRepositoryJsonBuilder
withJsonResource(InputStream inputStream)
Add the content of aConfigurationMetadataRepository
defined by the specifiedInputStream
json document using the default charset.ConfigurationMetadataRepositoryJsonBuilder
withJsonResource(InputStream inputStream, Charset charset)
Add the content of aConfigurationMetadataRepository
defined by the specifiedInputStream
json document using the specifiedCharset
.
Method Detail
withJsonResource
public ConfigurationMetadataRepositoryJsonBuilder withJsonResource(InputStream inputStream) throws IOException
Add the content of aConfigurationMetadataRepository
defined by the specifiedInputStream
json document using the default charset. If this metadata repository holds items that were loaded previously, these are ignored.Leaves the stream open when done.
- Parameters:
inputStream
- the source input stream- Returns:
- this builder
- Throws:
IOException
- in case of I/O errors
withJsonResource
public ConfigurationMetadataRepositoryJsonBuilder withJsonResource(InputStream inputStream, Charset charset) throws IOException
Add the content of aConfigurationMetadataRepository
defined by the specifiedInputStream
json document using the specifiedCharset
. If this metadata repository holds items that were loaded previously, these are ignored.Leaves the stream open when done.
- Parameters:
inputStream
- the source input streamcharset
- the charset of the input- Returns:
- this builder
- Throws:
IOException
- in case of I/O errors
build
public ConfigurationMetadataRepository build()
Build aConfigurationMetadataRepository
with the current state of this builder.- Returns:
- this builder
create
public static ConfigurationMetadataRepositoryJsonBuilder create(InputStream... inputStreams) throws IOException
Create a new builder instance usingStandardCharsets.UTF_8
as the default charset and the specified json resource.- Parameters:
inputStreams
- the source input streams- Returns:
- a new
ConfigurationMetadataRepositoryJsonBuilder
instance. - Throws:
IOException
- on error
create
public static ConfigurationMetadataRepositoryJsonBuilder create()
Create a new builder instance usingStandardCharsets.UTF_8
as the default charset.- Returns:
- a new
ConfigurationMetadataRepositoryJsonBuilder
instance.
create
public static ConfigurationMetadataRepositoryJsonBuilder create(Charset defaultCharset)
Create a new builder instance using the specified defaultCharset
.- Parameters:
defaultCharset
- the default charset to use- Returns:
- a new
ConfigurationMetadataRepositoryJsonBuilder
instance.