Package jcckit.util
Class ConfigParametersBasedConfigData
java.lang.Object
jcckit.util.ConfigParametersBasedConfigData
- All Implemented Interfaces:
ConfigData
An implementation of
ConfigData based on two instances of
ConfigParameters. The second one serves as a set of
default parameters. It will be used if the first one has not the requested
key-value pair.-
Constructor Summary
ConstructorsConstructorDescriptionConfigParametersBasedConfigData(ConfigParameters config, ConfigParameters defaultConfig) Creates an instance. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value associated with this key.getFullKey(String key) Returns the full key.Returns the ConfigData object associated with this key.
-
Constructor Details
-
ConfigParametersBasedConfigData
Creates an instance.- Parameters:
config- A set of key-value pairs.defaultConfig- The default set of key-value pairs.
-
-
Method Details
-
getFullKey
Returns the full key.- Specified by:
getFullKeyin interfaceConfigData- Parameters:
key- A (relative) key. null is not allowed.- Returns:
- the full key including path.
-
get
Returns the value associated with this key.- Specified by:
getin interfaceConfigData- Parameters:
key- The relative key. null is not allowed.- Returns:
- the associated value. Will be null if no value exists for key.
-
getNode
Returns the ConfigData object associated with this key.- Specified by:
getNodein interfaceConfigData- Parameters:
key- The relative key. null is not allowed.- Returns:
- the associated value. Will never return null. Instead an empty ConfigData is returned.
-