Package org.openhab.core.automation.util
Class ConfigurationNormalizer
java.lang.Object
org.openhab.core.automation.util.ConfigurationNormalizer
This class provides utility methods used by
RuleRegistry to resolve and normalize the RuleImpls
configuration values.- Author:
- Ana Dimova - Initial contribution
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Map<String, ConfigDescriptionParameter> getConfigDescriptionMap(List<ConfigDescriptionParameter> configDesc) Converts a list ofConfigDescriptionParameters to a map with the parameter's names as keys.static voidnormalizeConfiguration(Configuration configuration, Map<String, ConfigDescriptionParameter> configDescriptionMap) Normalizes the types of the configuration's parameters to the allowed ones.static <T extends Module>
voidnormalizeModuleConfigurations(List<T> modules, ModuleTypeRegistry mtRegistry) Normalizes the configurations of the providedModuleImpls.
-
Constructor Details
-
ConfigurationNormalizer
public ConfigurationNormalizer()
-
-
Method Details
-
normalizeModuleConfigurations
public static <T extends Module> void normalizeModuleConfigurations(List<T> modules, ModuleTypeRegistry mtRegistry) Normalizes the configurations of the providedModuleImpls.- Parameters:
modules- a list ofModuleImpls to normalize.mtRegistry- theModuleTypeRegistrythat provides the meta-data needed for the normalization.- See Also:
-
getConfigDescriptionMap
public static Map<String,ConfigDescriptionParameter> getConfigDescriptionMap(List<ConfigDescriptionParameter> configDesc) Converts a list ofConfigDescriptionParameters to a map with the parameter's names as keys.- Parameters:
configDesc- the list to convert.- Returns:
- a map that maps parameter names to
ConfigDescriptionParameterinstances.
-
normalizeConfiguration
public static void normalizeConfiguration(Configuration configuration, Map<String, ConfigDescriptionParameter> configDescriptionMap) Normalizes the types of the configuration's parameters to the allowed ones. References are ignored. Null values are replaced with the defaults and then normalized.- Parameters:
configuration- the configuration to normalize.configDescriptionMap- the meta-data of the configuration.
-