Interface OverrideSource
- All Superinterfaces:
Source, Supplier<OverrideSource>
- All Known Implementing Classes:
ClasspathOverrideSource, FileOverrideSource, InMemoryOverrideSource, UrlOverrideSource
Source of config override settings.
A config override setting provides an alternate, or overriding, value for a
config element based on the element's key. Implementations of this interface
furnish override settings as OverrideSource.OverrideData objects.
The OverrideSource.OverrideData.data method returns a List of pairs, each of
which contains a Predicate which evaluates the config key and a
String which is the overriding value to be used if the predicate is
true. The config system applies overrides before it applies
filters, and it applies only the first matching override
it finds.
The config override mechanism affects existing Config nodes that come
from a ConfigSource. The override mechanism cannot create additional
Config nodes, only modify existing ones.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classGroup of config override settings.Nested classes/interfaces inherited from interface Source
Source.Builder<B>Modifier and TypeInterfaceDescriptionstatic interfaceSource.Builder<B extends Source.Builder<B>>Configurable options of aSource. -
Method Summary
Modifier and TypeMethodDescriptiondefault OverrideSourceget()load()Load override data from the underlying source.Methods inherited from interface Source
description, exists, optional, retryPolicyModifier and TypeMethodDescriptiondefault StringShort, human-readable summary referring to the underlying source.default booleanexists()If the underlying data exist at this time.default booleanoptional()Whether this source is optional.default Optional<RetryPolicy> Retry policy configured on this config source.
-
Method Details
-
get
- Specified by:
getin interfaceSupplier<OverrideSource>
-
load
Load override data from the underlying source.- Returns:
- override data if present, empty otherwise
- Throws:
ConfigException- in case the loading of data failed
-