public class ConfigurationManager extends Object
Modifier and Type | Method and Description |
---|---|
boolean |
getBooleanConfiguration(String arg,
boolean defaultValue)
Check if a specific boolean configuration exists.
|
static ConfigurationManager |
getInstance() |
String |
getStringConfiguration(String arg,
String defaultValue)
Get a specific String configuration.
|
void |
loadArguments(String[] args)
Collects arguments of the form --word, --word=otherword and -blah
to determine user parameters.
|
void |
loadBooleanConfiguration(String arg)
Add a boolean configuration.
|
void |
loadStringConfiguration(String arg,
int equalsPosition)
Add a String configuration which consists a key and a value.
|
public static ConfigurationManager getInstance()
public void loadArguments(String[] args)
args
- Command line arguments to the applicationpublic void loadBooleanConfiguration(String arg)
arg
- The key we wish to add as a configuration.public void loadStringConfiguration(String arg, int equalsPosition)
arg
- String of the form substring1=substring2.equalsPosition
- Position of the '=' element.public boolean getBooleanConfiguration(String arg, boolean defaultValue)
arg
- The key for the configuration.defaultValue
- If the configuration is not found, we use a default value.public String getStringConfiguration(String arg, String defaultValue)
arg
- The key for the configuration.defaultValue
- If the configuration is not found, we use a default value.