
public final class ConfigDataChecker<T> extends Object
Integer/Long.decode(String) is used to check and convert. For Double values
Double.valueOf(String) is used. For enums, the string is converted to
uppercase and then appropriate {@code valueOf(String)} method is used.| Constructor and Description |
|---|
ConfigDataChecker(Constructor<T> construct)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
List<String> |
checkAllPresent(Map<String,String> config)
Checks for missing data by key.
|
List<String> |
checkAllTypes(Map<String,String> config)
Checks that configuration data items have the right types.
|
T |
convertAll(Map<String,String> config)
Converts the set of configuration data items to an object of type T,
provided that none are missing or invalid.
|
public ConfigDataChecker(Constructor<T> construct)
reference - The reference constructor against which to check a configuration.public List<String> checkAllPresent(Map<String,String> config)
config - The configuration data to be checked.public List<String> checkAllTypes(Map<String,String> config)
config - The configuration data to check.checkAllPresent(java.util.Map)public T convertAll(Map<String,String> config)
config - The configuration data to convert.checkAllPresent(java.util.Map),
checkAllTypes(java.util.Map)Copyright © 2016 LSST. All rights reserved.