Package net.obvj.confectory.merger
Class AbstractConfigurationMerger<T>
- java.lang.Object
-
- net.obvj.confectory.merger.AbstractConfigurationMerger<T>
-
- Type Parameters:
T- the source and targetConfigurationtype
- All Implemented Interfaces:
ConfigurationMerger<T>
- Direct Known Subclasses:
GenericJsonConfigurationMerger,PropertiesConfigurationMerger
public abstract class AbstractConfigurationMerger<T> extends Object implements ConfigurationMerger<T>
An abstractConfigurationMergerthat contains common infrastructure logic for the merging of twoConfigurationobjects, delegating the actual combination to a concrete implementation.- Since:
- 2.1.0
- Author:
- oswaldo.bapvic.jr (Oswaldo Junior)
-
-
Constructor Summary
Constructors Constructor Description AbstractConfigurationMerger()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Configuration<T>merge(Configuration<T> config1, Configuration<T> config2, net.obvj.jsonmerge.JsonMergeOption... mergeOptions)Combines twoConfigurationobjects into a newConfiguration.
-
-
-
Method Detail
-
merge
public final Configuration<T> merge(Configuration<T> config1, Configuration<T> config2, net.obvj.jsonmerge.JsonMergeOption... mergeOptions)
Description copied from interface:ConfigurationMergerCombines twoConfigurationobjects into a newConfiguration.The resulting object will receive all the elements of both input objects. In case of conflicting keys, the values at the highest-precedence
Configurationwill be selected.The metadata of the highest-precedence
Configuration(namespace and precedence) will be applied to the newConfiguration.- Specified by:
mergein interfaceConfigurationMerger<T>- Parameters:
config1- the firstConfiguration; not nullconfig2- the secondConfiguration; not nullmergeOptions- an array of options on how to merge JSON objects (optional)- Returns:
- a new
Configurationresulting from the combination ofconfig1andconfig2 - Throws:
NullPointerException- if a nullConfigurationis received
-
-