Module io.helidon.config
Package io.helidon.config
Class AbstractSourceBuilder<B extends AbstractSourceBuilder<B,U>,U>
java.lang.Object
io.helidon.config.AbstractSourceBuilder<B,U>
- Type Parameters:
B- type of implementation class of the builderU- type of target for watchable sources, useVoidif not supported
- All Implemented Interfaces:
Source.Builder<B>
- Direct Known Subclasses:
AbstractConfigSourceBuilder,ClasspathOverrideSource.Builder,FileOverrideSource.Builder,UrlOverrideSource.Builder
public abstract class AbstractSourceBuilder<B extends AbstractSourceBuilder<B,U>,U>
extends Object
implements Source.Builder<B>
Base class for common builder methods of a
Source
implementation.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected BchangeWatcher(ChangeWatcher<U> changeWatcher) Configure a change watcher.protected BConfigure builder from meta configuration.optional(boolean optional) Whether the source is optional or not.protected BpollingStrategy(PollingStrategy pollingStrategy) Configure a polling strategy.retryPolicy(Supplier<? extends RetryPolicy> policy) Configure a retry policy to be used with this source.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.helidon.config.spi.Source.Builder
optional
-
Constructor Details
-
AbstractSourceBuilder
protected AbstractSourceBuilder()No side effects.
-
-
Method Details
-
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.- Parameters:
metaConfig- meta configuration of this source- Returns:
- updated builder instance
-
retryPolicy
Description copied from interface:Source.BuilderConfigure a retry policy to be used with this source. If none is configured, the source is invoked directly with no retries.- Specified by:
retryPolicyin interfaceSource.Builder<B extends AbstractSourceBuilder<B,U>> - Parameters:
policy- retry policy to use- Returns:
- updated builder instance
-
optional
Description copied from interface:Source.BuilderWhether the source is optional or not. When configured to be optional, missing underlying data do not cause an exception to be raised.- Specified by:
optionalin interfaceSource.Builder<B extends AbstractSourceBuilder<B,U>> - Parameters:
optional-truewhen this source should be optional- Returns:
- updated builder instance
-
changeWatcher
Configure 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.- Parameters:
changeWatcher- change watcher to use, such asFileSystemWatcher- Returns:
- updated builder instance
-
pollingStrategy
Configure 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.- Parameters:
pollingStrategy- polling strategy to use- Returns:
- updated builder instance
-