public class Configuration extends Object
Modifier and Type | Field and Description |
---|---|
static String |
PATH_QUERY_PARAM |
Constructor and Description |
---|
Configuration(Object... keyAndValues)
Convenience constructor for setting up base configuration with key values pairs.
|
Modifier and Type | Method and Description |
---|---|
boolean |
containsKey(ConfigKey pKey)
Check whether a key is explicitely provided
|
String |
get(ConfigKey pKey)
Get a configuration value if set as configuration or the default
value if not
|
boolean |
getAsBoolean(ConfigKey pKey)
Get an configuration value as boolean value.
|
int |
getAsInt(ConfigKey pKey)
Get an configuration value as int value
|
ProcessingParameters |
getProcessingParameters(Map<String,String> pParams)
Get processing parameters from a string-string map
|
int |
size()
Get the number of stored configuration values
|
void |
updateGlobalConfiguration(ConfigExtractor pExtractor)
Update the configuration hold by this object
|
void |
updateGlobalConfiguration(Map<String,String> pConfig)
Update this global configuration from a string-string.
|
public static final String PATH_QUERY_PARAM
public Configuration(Object... keyAndValues)
keyAndValues
- an array with even number of elements and ConfigKey and String alternatingpublic void updateGlobalConfiguration(ConfigExtractor pExtractor)
pExtractor
- an extractor for retrieving the configuration from some external objectpublic void updateGlobalConfiguration(Map<String,String> pConfig)
pConfig
- config map from where to take the configurationpublic String get(ConfigKey pKey)
pKey
- the configuration key to lookuppublic int getAsInt(ConfigKey pKey)
pKey
- the configuration keypublic ProcessingParameters getProcessingParameters(Map<String,String> pParams)
pParams
- params to extra. A parameter "p" is used as extra path infopublic boolean getAsBoolean(ConfigKey pKey)
pKey
- the configuration key for which a boolean config value is requestedpublic int size()
public boolean containsKey(ConfigKey pKey)
pKey
- key to checkCopyright © 2017. All rights reserved.