Class DirectoryConfigSource.Builder
java.lang.Object
io.helidon.config.AbstractSourceBuilder<DirectoryConfigSource.Builder, Path>
io.helidon.config.AbstractConfigSourceBuilder<DirectoryConfigSource.Builder, Path>
io.helidon.config.DirectoryConfigSource.Builder
- All Implemented Interfaces:
Builder<DirectoryConfigSource.Builder, DirectoryConfigSource>, PollableSource.Builder<DirectoryConfigSource.Builder>, Source.Builder<DirectoryConfigSource.Builder>, WatchableSource.Builder<DirectoryConfigSource.Builder, Path>, Supplier<DirectoryConfigSource>
- Enclosing class:
DirectoryConfigSource
public static final class DirectoryConfigSource.Builder
extends AbstractConfigSourceBuilder<DirectoryConfigSource.Builder, Path>
implements PollableSource.Builder<DirectoryConfigSource.Builder>, WatchableSource.Builder<DirectoryConfigSource.Builder, Path>, Builder<DirectoryConfigSource.Builder, DirectoryConfigSource>
A fluent API builder for
DirectoryConfigSource.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds new instance of Directory ConfigSource.changeWatcher(ChangeWatcher<Path> changeWatcher) Configure a change watcher.Configure builder from meta configuration.Configuration directory path.pollingStrategy(PollingStrategy pollingStrategy) Configure a polling strategy.Methods inherited from class AbstractConfigSourceBuilder
mediaType, mediaTypeMapping, parser, parserMappingModifier and TypeMethodDescriptionprotected DirectoryConfigSource.BuilderMedia type if this is aParsableSourceand explicit media type is configured.mediaTypeMapping(Function<Config.Key, Optional<MediaType>> mediaTypeMapping) Sets a function that maps keys to media type.protected DirectoryConfigSource.Builderparser(ConfigParser parser) A parser if this is aParsableSourceand explicit parser is configured.parserMapping(Function<Config.Key, Optional<ConfigParser>> parserMapping) Sets a function that maps keys to a parser.Methods inherited from class AbstractSourceBuilder
optional, retryPolicyModifier and TypeMethodDescriptionoptional(boolean optional) Whether the source is optional or not.retryPolicy(Supplier<? extends RetryPolicy> policy) Configure a retry policy to be used with this source.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Builder
get, identity, updateModifier and TypeMethodDescriptiondefault DirectoryConfigSourceget()default DirectoryConfigSource.Builderidentity()Instance of this builder as the correct type.default DirectoryConfigSource.Builderupdate(Consumer<DirectoryConfigSource.Builder> consumer) Update the builder in a fluent API way.Methods inherited from interface PollableSource.Builder
pollingStrategyModifier and TypeMethodDescriptiondefault DirectoryConfigSource.BuilderpollingStrategy(Supplier<? extends PollingStrategy> pollingStrategy) Configure the polling strategy to use.Methods inherited from interface Source.Builder
optionalModifier and TypeMethodDescriptiondefault DirectoryConfigSource.Builderoptional()Configure this source to be optional.
-
Method Details
-
build
Builds new instance of Directory ConfigSource.- Specified by:
buildin interfaceBuilder<DirectoryConfigSource.Builder, DirectoryConfigSource>- Returns:
- new instance of File ConfigSource.
-
config
Configure builder from meta configuration.The following configuration options are supported:
Optional configuration parameters key default value description optional falseConfigure to trueif this source should not fail configuration setup when underlying data is missing.polling-strategy No polling strategy is added by default Meta configuration of a polling strategy to be used with this source, add configuration to propertiessub node.change-watcher No change watcher is added by default Meta configuration of a change watcher to be used with this source, add configuration to propertiessub node.retry-policy No retry policy is added by default Meta configuration of a retry policy to be used to load this source, add configuration to propertiessub node.Media type and type mapping media-type Media type from loaded data is used by default for parsable config sources Explicit media type to use, such as when a file has invalid suffix, or when we need to explicitly mark the media type. media-type-mapping No media type mapping is done by default A mapping of key to a media type, allowing us to have a key that contains a sub-tree (e.g. a key that contains json data) - when we configure a mapping of the key to application/json, the data would be expanded into config as a proper tree structurepath- directory path
- Overrides:
configin classAbstractConfigSourceBuilder<DirectoryConfigSource.Builder, Path>- Parameters:
metaConfig- configuration properties used to configure a builder instance.- Returns:
- updated builder instance
-
path
Configuration directory path.- Parameters:
path- directory- Returns:
- updated builder instance
-
changeWatcher
Description copied from class:AbstractSourceBuilderConfigure a change watcher. This method must be exposed by builders of sources that change watching (WatchableSource). The type of the change watcher must match the type of the target of this source.- Specified by:
changeWatcherin interfaceWatchableSource.Builder<DirectoryConfigSource.Builder, Path>- Overrides:
changeWatcherin classAbstractSourceBuilder<DirectoryConfigSource.Builder, Path>- Parameters:
changeWatcher- change watcher to use, such asFileSystemWatcher- Returns:
- updated builder instance
-
pollingStrategy
Description copied from class:AbstractSourceBuilderConfigure a polling strategy. This method must be exposed by builders of sources that support polling. If you see this method as being protected in your builder, the source has removed support for polling, such asClasspathConfigSource.- Specified by:
pollingStrategyin interfacePollableSource.Builder<DirectoryConfigSource.Builder>- Overrides:
pollingStrategyin classAbstractSourceBuilder<DirectoryConfigSource.Builder, Path>- Parameters:
pollingStrategy- polling strategy to use- Returns:
- updated builder instance
-