B - type of Builder implementationT - type of key source attributes (target) used to construct polling strategy fromjava.util.function.Supplier<ConfigSource>AbstractParsableConfigSource.Builderpublic abstract static class AbstractConfigSource.Builder<B extends AbstractConfigSource.Builder<B,T>,T> extends AbstractSource.Builder<B,T,ConfigSource> implements java.util.function.Supplier<ConfigSource>
ConfigSource builder ready to be extended by builder implementation related to ConfigSource
extensions.
It allows to configure following properties:
mediaTypeMapping - a mapping of a key to a media typeparserMapping - a mapping of a key to a ConfigParser| Modifier | Constructor | Description |
|---|---|---|
protected |
Builder(java.lang.Class<T> targetType) |
Initialize builder.
|
| Modifier and Type | Method | Description |
|---|---|---|
ConfigSource |
get() |
|
protected java.util.function.Function<Config.Key,java.lang.String> |
getMediaTypeMapping() |
|
protected java.util.function.Function<Config.Key,ConfigParser> |
getParserMapping() |
|
protected B |
init(Config metaConfig) |
Initialize builder from specified configuration properties.
|
B |
mediaTypeMapping(java.util.function.Function<Config.Key,java.lang.String> mediaTypeMapping) |
Sets a function mapping key to media type.
|
B |
parserMapping(java.util.function.Function<Config.Key,ConfigParser> parserMapping) |
Sets a function mapping key to a parser.
|
build, changesExecutor, changesMaxBuffer, getChangesExecutor, getChangesMaxBuffer, getPollingStrategy, getRetryPolicy, getTarget, isMandatory, optional, pollingStrategy, pollingStrategy, retryPolicyprotected Builder(java.lang.Class<T> targetType)
targetType - target typepublic ConfigSource get()
get in interface java.util.function.Supplier<B extends AbstractConfigSource.Builder<B,T>>protected B init(Config metaConfig)
Supported configuration properties:
optional - type boolean, see AbstractSource.Builder.optional()polling-strategy - see PollingStrategy for details about configuration format,
see AbstractSource.Builder.pollingStrategy(Supplier) or AbstractSource.Builder.pollingStrategy(Function)media-type-mapping - type Map - key to media type, see mediaTypeMapping(Function)init in class AbstractSource.Builder<B extends AbstractConfigSource.Builder<B,T>,T,ConfigSource>metaConfig - configuration properties used to initialize a builder instance.public B mediaTypeMapping(java.util.function.Function<Config.Key,java.lang.String> mediaTypeMapping)
mediaTypeMapping - a mapping functionpublic B parserMapping(java.util.function.Function<Config.Key,ConfigParser> parserMapping)
parserMapping - a mapping functionprotected java.util.function.Function<Config.Key,java.lang.String> getMediaTypeMapping()
protected java.util.function.Function<Config.Key,ConfigParser> getParserMapping()
Copyright © 2018, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.