public final class ConfigHolder extends Object
Modifier and Type | Field and Description |
---|---|
protected Map<String,Object> |
configs
Configurations map.
|
Modifier and Type | Method and Description |
---|---|
void |
add(String key,
Object value)
Adds the given key-value pair to this holder.
|
void |
addAll(Properties properties)
Adds all properities contained in the given Properties object to this holder.
|
Object |
get(String key,
Object defaultValue)
Returns the value for the given key as an Object if existing.
|
Properties |
getAll()
Returns all properties of this holder as a Properties object.
|
boolean |
getAsBoolean(String key,
boolean defaultValue)
Returns the value for the given key as a Boolean if existing.
|
int |
getAsInteger(String key,
int defaultValue)
Returns the value for the given key as an Integer if existing.
|
String |
getAsString(String key,
String defaultValue)
Returns the value for the given key as a String if existing.
|
static ConfigHolder |
getInstance()
Returns an instance of this class.
|
String |
printCurrentConfigs() |
public static ConfigHolder getInstance()
public void addAll(Properties properties)
properties
- The Properties to hold.public Properties getAll()
public void add(String key, Object value)
key
- The key of the configuration.value
- The value of the configuration.public Object get(String key, Object defaultValue)
key
- The key for the configuration value to get.defaultValue
- The default value if the configuration is not existing.public boolean getAsBoolean(String key, boolean defaultValue)
key
- The key for the configuration value to get.defaultValue
- default value if the configuration is not existing.public int getAsInteger(String key, int defaultValue)
key
- The key for the configuration value to get.defaultValue
- default value if the configuration is not existing.public String getAsString(String key, String defaultValue)
key
- The key for the configuration value to get.defaultValue
- default value if the configuration is not existing.public String printCurrentConfigs()
Copyright © 2020 Hyland Software Germany GmbH. All rights reserved.