Module io.inverno.mod.configuration
Class MapConfigurationSource
java.lang.Object
io.inverno.mod.configuration.AbstractConfigurationSource<AbstractHashConfigurationSource.HashConfigurationQuery<Object,MapConfigurationSource>,AbstractHashConfigurationSource.HashExecutableConfigurationQuery<Object,MapConfigurationSource>,AbstractHashConfigurationSource.HashListConfigurationQuery<Object,MapConfigurationSource>,Object>
io.inverno.mod.configuration.AbstractHashConfigurationSource<Object,MapConfigurationSource>
io.inverno.mod.configuration.source.MapConfigurationSource
- All Implemented Interfaces:
ConfigurationSource<AbstractHashConfigurationSource.HashConfigurationQuery<Object,
,MapConfigurationSource>, AbstractHashConfigurationSource.HashExecutableConfigurationQuery<Object, MapConfigurationSource>, AbstractHashConfigurationSource.HashListConfigurationQuery<Object, MapConfigurationSource>> DefaultableConfigurationSource<AbstractHashConfigurationSource.HashConfigurationQuery<Object,
MapConfigurationSource>, AbstractHashConfigurationSource.HashExecutableConfigurationQuery<Object, MapConfigurationSource>, AbstractHashConfigurationSource.HashListConfigurationQuery<Object, MapConfigurationSource>, MapConfigurationSource>
public class MapConfigurationSource
extends AbstractHashConfigurationSource<Object,MapConfigurationSource>
A configuration source that looks up properties from a map.
This source supports parameterized configuration properties defined as follows:
Map<String, Object> map = Map.of(
"web.server_port", 8080,
"db.url[env=\"dev\"]", "jdbc:oracle:thin:@dev.db.server:1521:sid",
"db.url[env=\"prod\",zone=\"eu\"]", "jdbc:oracle:thin:@prod_eu.db.server:1521:sid",
"db.url[env=\"prod\",zone=\"eu\"]", "jdbc:oracle:thin:@prod_eu.db.server:1521:sid",
"db.url[env=\"prod\",zone=\"us\"]", "jdbc:oracle:thin:@prod_us.db.server:1521:sid"
);
- Since:
- 1.0
- Author:
- Jeremy Kuhn
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class io.inverno.mod.configuration.AbstractHashConfigurationSource
AbstractHashConfigurationSource.HashConfigurationQuery<A,
B extends AbstractHashConfigurationSource<A, B>>, AbstractHashConfigurationSource.HashConfigurationQueryResult<A, B extends AbstractHashConfigurationSource<A, B>>, AbstractHashConfigurationSource.HashExecutableConfigurationQuery<A, B extends AbstractHashConfigurationSource<A, B>>, AbstractHashConfigurationSource.HashListConfigurationQuery<A, B extends AbstractHashConfigurationSource<A, B>> -
Field Summary
Modifier and TypeFieldDescriptionThe map holding configuration dataFields inherited from class io.inverno.mod.configuration.AbstractHashConfigurationSource
defaultingStrategy, initial
Fields inherited from class io.inverno.mod.configuration.AbstractConfigurationSource
decoder
-
Constructor Summary
ConstructorDescriptionMapConfigurationSource
(Map<String, Object> properties) Creates a map configuration source with the specified map.MapConfigurationSource
(Map<String, Object> map, SplittablePrimitiveDecoder<Object> decoder) Creates a map configuration source with the specified map and string value decoder. -
Method Summary
Modifier and TypeMethodDescriptionprotected Mono
<List<ConfigurationProperty>> load()
Loads the configuration properties.withDefaultingStrategy
(DefaultingStrategy defaultingStrategy) Returns a proxy of the defaultable configuration source instance using the specified defaulting strategy.Methods inherited from class io.inverno.mod.configuration.AbstractHashConfigurationSource
get, list, unwrap
Methods inherited from class io.inverno.mod.configuration.AbstractConfigurationSource
getDecoder, setDecoder
-
Field Details
-
map
The map holding configuration data
-
-
Constructor Details
-
MapConfigurationSource
Creates a map configuration source with the specified map.
- Parameters:
properties
- a map of properties
-
MapConfigurationSource
Creates a map configuration source with the specified map and string value decoder.
- Parameters:
map
- a map defining the propertiesdecoder
- a string decoder
-
-
Method Details
-
withDefaultingStrategy
Description copied from interface:DefaultableConfigurationSource
Returns a proxy of the defaultable configuration source instance using the specified defaulting strategy.
- Parameters:
defaultingStrategy
- a defaulting strategy- Returns:
- a new defaultable configuration source
-
load
Description copied from class:AbstractHashConfigurationSource
Loads the configuration properties.
- Specified by:
load
in classAbstractHashConfigurationSource<Object,
MapConfigurationSource> - Returns:
- A mono emitting the list of configuration properties
-