public interface Config
| Modifier and Type | Interface and Description |
|---|---|
static class |
Config.Match
Possible matching rules
|
| Modifier and Type | Method and Description |
|---|---|
Config |
filterPrefix(String prefix)
Returns a Config instance with the prefixed properties
|
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
|
Iterable<String> |
getKeys(String keyPrefix)
Get the list of the keys contained in the configuration.
|
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,
Config.Match keyMatchingRule,
ConfigChangedCallback callback)
Registers a listener on given property.
|
void |
listen(String key,
Config.Match keyMatchingRule,
PropertyChangedCallback callback)
Registers a listener on given property.
|
void |
listen(String key,
ConfigChangedCallback callback)
Registers a listener on given property.
|
void |
listen(String key,
PropertyChangedCallback 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, Config.Match keyMatchingRule, PropertyChangedCallback callback)
key - - the property namekeyMatchingRule - - the key matching rulecallback - - the callback functionvoid listen(String key, PropertyChangedCallback callback)
key - - the property namecallback - - the callback functionvoid listen(String key, Config.Match keyMatchingRule, ConfigChangedCallback callback)
key - - the property namekeyMatchingRule - - the key matching rulecallback - - the callback functionvoid 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 namevoid setProperty(String key, Object value)
key - the key/name of the property to altervalue - the value to be alteredIterable<String> getKeys(String keyPrefix)
keyPrefix - Copyright © 2016 Irenical. All rights reserved.