public interface Config
| Modifier and Type | Method and Description |
|---|---|
boolean |
getBoolean(String key,
boolean defaultValue)
Returns the boolean value for given property
|
float |
getFloat(String key,
float defaultValue)
Returns the float value for given property
|
int |
getInt(String key,
int defaultValue)
Returns the int value for given property
|
boolean |
getMandatoryBoolean(String key)
Returns the boolean value for given property
|
float |
getMandatoryFloat(String key)
Returns the float value for given property
|
int |
getMandatoryInt(String key)
Returns the int value for given property
|
String |
getMandatoryString(String key)
Returns the string value for given property
|
String |
getString(String key)
Returns the string value for given property
|
String |
getString(String key,
String defaultValue)
Returns the string value for given property
|
String[] |
getStringArray(String key)
Returns the string array for given property
|
void |
listen(String key,
ConfigChangedCallback callback)
Registers a listener on given property.
|
void |
setProperty(String key,
Object value)
Set a property, this will replace any previously set values.
|
void |
unListen(ConfigChangedCallback callback)
Unregisters listener on all keys
|
void listen(String key, ConfigChangedCallback callback)
key - - the property namecallback - - the callback functionvoid unListen(ConfigChangedCallback callback)
callback - - the callback function earlier registered with listen()boolean getMandatoryBoolean(String key) throws ConfigNotFoundException
key - - the property nameConfigNotFoundException - - if the property is not setboolean getBoolean(String key, boolean defaultValue)
key - - the property namedefaultValue - - the returned value if the property is not setfloat getMandatoryFloat(String key) throws ConfigNotFoundException
key - - the property nameConfigNotFoundException - - if the property is not setfloat getFloat(String key, float defaultValue)
key - - the property namedefaultValue - - the returned value if the property is not setint getMandatoryInt(String key) throws ConfigNotFoundException
key - - the property nameConfigNotFoundException - - if the property is not setint getInt(String key, int defaultValue)
key - - the property namedefaultValue - - the returned value if the property is not setString getMandatoryString(String key) throws ConfigNotFoundException
key - - the property nameConfigNotFoundException - - if the property is not setString getString(String key)
key - - the property nameString getString(String key, String defaultValue)
key - - the property namedefaultValue - - the returned value if the property is not setString[] getStringArray(String key)
key - - the property nameCopyright © 2015 Irenical. All rights reserved.