Package io.helidon.config.spi
Class AbstractConfigSource.Builder<B extends AbstractConfigSource.Builder<B,T>,T>
- java.lang.Object
-
- io.helidon.config.spi.AbstractSource.Builder<B,T,ConfigSource>
-
- io.helidon.config.spi.AbstractConfigSource.Builder<B,T>
-
- Type Parameters:
B
- type of Builder implementationT
- type of key source attributes (target) used to construct polling strategy from
- All Implemented Interfaces:
Builder<ConfigSource>
,Supplier<ConfigSource>
- Direct Known Subclasses:
AbstractParsableConfigSource.Builder
- Enclosing class:
- AbstractConfigSource<S>
public abstract static class AbstractConfigSource.Builder<B extends AbstractConfigSource.Builder<B,T>,T> extends AbstractSource.Builder<B,T,ConfigSource> implements Builder<ConfigSource>
A commonConfigSource
builder ready to be extended by builder implementation related toConfigSource
extensions.It allows to configure following properties:
mediaTypeMapping
- a mapping of a key to a media typeparserMapping
- a mapping of a key to aConfigParser
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConfigSource
get()
protected B
init(Config metaConfig)
Initialize builder from specified configuration properties.protected Function<Config.Key,String>
mediaTypeMapping()
Media type mapping function.B
mediaTypeMapping(Function<Config.Key,String> mediaTypeMapping)
Sets a function mapping key to media type.protected Function<Config.Key,ConfigParser>
parserMapping()
Parser mapping function.B
parserMapping(Function<Config.Key,ConfigParser> parserMapping)
Sets a function mapping key to a parser.-
Methods inherited from class io.helidon.config.spi.AbstractSource.Builder
build, changesExecutor, changesExecutor, changesMaxBuffer, changesMaxBuffer, isMandatory, optional, pollingStrategy, pollingStrategy, pollingStrategy, retryPolicy, retryPolicy, target, thisBuilder
-
-
-
-
Method Detail
-
get
public ConfigSource get()
-
init
protected B init(Config metaConfig)
Initialize builder from specified configuration properties.Supported configuration
properties
:optional
- typeboolean
, seeAbstractSource.Builder.optional()
polling-strategy
- seePollingStrategy
for details about configuration format, seeAbstractSource.Builder.pollingStrategy(Supplier)
orAbstractSource.Builder.pollingStrategy(Function)
media-type-mapping
- typeMap
- key to media type, seemediaTypeMapping(Function)
- Overrides:
init
in classAbstractSource.Builder<B extends AbstractConfigSource.Builder<B,T>,T,ConfigSource>
- Parameters:
metaConfig
- configuration properties used to initialize a builder instance.- Returns:
- modified builder instance
-
mediaTypeMapping
public B mediaTypeMapping(Function<Config.Key,String> mediaTypeMapping)
Sets a function mapping key to media type.- Parameters:
mediaTypeMapping
- a mapping function- Returns:
- a modified builder
-
parserMapping
public B parserMapping(Function<Config.Key,ConfigParser> parserMapping)
Sets a function mapping key to a parser.- Parameters:
parserMapping
- a mapping function- Returns:
- a modified builder
-
mediaTypeMapping
protected Function<Config.Key,String> mediaTypeMapping()
Media type mapping function.- Returns:
- media type mapping
-
parserMapping
protected Function<Config.Key,ConfigParser> parserMapping()
Parser mapping function.- Returns:
- parser mapping
-
-