Package io.helidon.config
Interface ConfigSources.MergingStrategy
-
- Enclosing class:
- ConfigSources
public static interface ConfigSources.MergingStrategyAn algorithm for combining multipleConfigNode.ObjectNoderoot nodes into a singleConfigNode.ObjectNoderoot node.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static ConfigSources.MergingStrategyfallback()Returns an implementation ofMergingStrategyin which nodes from a root earlier in the list have higher priority than nodes from a root later in the list.ConfigNode.ObjectNodemerge(List<ConfigNode.ObjectNode> rootNodes)Merges an ordered list ofConfigNode.ObjectNodes into a single instance.
-
-
-
Method Detail
-
merge
ConfigNode.ObjectNode merge(List<ConfigNode.ObjectNode> rootNodes)
Merges an ordered list ofConfigNode.ObjectNodes into a single instance.Typically nodes (object, list or value) from a root earlier in the list are considered to have a higher priority than nodes from a root that appears later in the list, but this is not required and is entirely up to each
MergingStrategyimplementation.- Parameters:
rootNodes- list of root nodes to combine- Returns:
- ObjectNode root node resulting from the merge
-
fallback
static ConfigSources.MergingStrategy fallback()
Returns an implementation ofMergingStrategyin which nodes from a root earlier in the list have higher priority than nodes from a root later in the list.The merged behavior is as if the resulting merged
Config, when resolving a value of a key, consults theConfigroots in the order they were passed tomerge. As soon as it finds aConfigtree containing a value for the key is it immediately returns that value, disregarding other later config roots.- Returns:
- new instance of fallback merging strategy
-
-