Class FileOverrideSource.Builder
java.lang.Object
io.helidon.config.AbstractSourceBuilder<FileOverrideSource.Builder, Path>
io.helidon.config.FileOverrideSource.Builder
- All Implemented Interfaces:
Builder<FileOverrideSource.Builder, FileOverrideSource>, PollableSource.Builder<FileOverrideSource.Builder>, Source.Builder<FileOverrideSource.Builder>, WatchableSource.Builder<FileOverrideSource.Builder, Path>, Supplier<FileOverrideSource>
- Enclosing class:
FileOverrideSource
public static final class FileOverrideSource.Builder
extends AbstractSourceBuilder<FileOverrideSource.Builder, Path>
implements PollableSource.Builder<FileOverrideSource.Builder>, WatchableSource.Builder<FileOverrideSource.Builder, Path>, Builder<FileOverrideSource.Builder, FileOverrideSource>
File OverrideSource Builder.
It allows to configure following properties:
path- configuration file path;mandatory- is existence of configuration resource mandatory (by default) or isoptional?
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds new instance of File ConfigSource.changeWatcher(ChangeWatcher<Path> changeWatcher) Configure a change watcher.Configure builder from meta configuration.Configure path to look for the source.pollingStrategy(PollingStrategy pollingStrategy) Configure a polling strategy.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 FileOverrideSourceget()default FileOverrideSource.Builderidentity()Instance of this builder as the correct type.default FileOverrideSource.Builderupdate(Consumer<FileOverrideSource.Builder> consumer) Update the builder in a fluent API way.Methods inherited from interface PollableSource.Builder
pollingStrategyModifier and TypeMethodDescriptiondefault FileOverrideSource.BuilderpollingStrategy(Supplier<? extends PollingStrategy> pollingStrategy) Configure the polling strategy to use.Methods inherited from interface Source.Builder
optionalModifier and TypeMethodDescriptiondefault FileOverrideSource.Builderoptional()Configure this source to be optional.
-
Method Details
-
build
Builds new instance of File ConfigSource.If
media-typenot set it tries to guess it from file extension.- Specified by:
buildin interfaceBuilder<FileOverrideSource.Builder, FileOverrideSource>- Returns:
- new instance of File ConfigSource.
-
config
Description copied from class:AbstractSourceBuilderConfigure 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.- Overrides:
configin classAbstractSourceBuilder<FileOverrideSource.Builder, Path>- Parameters:
metaConfig- meta configuration of this source- Returns:
- updated builder instance
-
path
Configure path to look for the source.- Parameters:
path- file path- Returns:
- updated builder
-
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<FileOverrideSource.Builder, Path>- Overrides:
changeWatcherin classAbstractSourceBuilder<FileOverrideSource.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<FileOverrideSource.Builder>- Overrides:
pollingStrategyin classAbstractSourceBuilder<FileOverrideSource.Builder, Path>- Parameters:
pollingStrategy- polling strategy to use- Returns:
- updated builder instance
-