Class ConfigurationProvider
java.lang.Object
is.galia.config.ConfigurationProvider
- All Implemented Interfaces:
Configuration
Configuration whose accessors access an ordered list of other configurations,
which enables "falling back" from one configuration source to another.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Clears any key-value pairs from the instance (but not its persistent store, if available).void
clearProperty
(String key) Removes a single key-value pair from the instance (but not its persistent store, if available).boolean
getBoolean
(String key) boolean
getBoolean
(String key, boolean defaultValue) double
double
getFile()
float
float
int
int
getKeys()
long
long
getProperty
(String key) void
reload()
Reloads the configuration from its persistent store.void
setProperty
(String key, Object value) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface is.galia.config.Configuration
clearProperty, getBoolean, getBoolean, getDouble, getDouble, getFloat, getFloat, getInt, getInt, getLong, getLong, getLongBytes, getLongBytes, getLongBytes, getLongBytes, getProperty, getString, getString, setProperty, toMap
-
Method Details
-
clear
public void clear()Description copied from interface:Configuration
Clears any key-value pairs from the instance (but not its persistent store, if available).- Specified by:
clear
in interfaceConfiguration
-
clearProperty
Description copied from interface:Configuration
Removes a single key-value pair from the instance (but not its persistent store, if available).- Specified by:
clearProperty
in interfaceConfiguration
- Parameters:
key
- Key to remove.
-
getBoolean
- Specified by:
getBoolean
in interfaceConfiguration
-
getBoolean
- Specified by:
getBoolean
in interfaceConfiguration
- Returns:
- Boolean value corresponding to the given key, or the given default value if the target value is null or cannot be coerced to a boolean.
-
getDouble
- Specified by:
getDouble
in interfaceConfiguration
-
getDouble
- Specified by:
getDouble
in interfaceConfiguration
- Returns:
- Double value corresponding to the given key, or the given default value if the target value is null or cannot be coerced to a double.
-
getFile
- Specified by:
getFile
in interfaceConfiguration
- Returns:
- The file backing the instance, if any.
-
getFloat
- Specified by:
getFloat
in interfaceConfiguration
-
getFloat
- Specified by:
getFloat
in interfaceConfiguration
- Returns:
- Float value corresponding to the given key, or the given default value if the target value is null or cannot be coerced to a float.
-
getInt
- Specified by:
getInt
in interfaceConfiguration
-
getInt
- Specified by:
getInt
in interfaceConfiguration
- Returns:
- Int value corresponding to the given key, or the given default value if the target value is null or cannot be coerced to an int.
-
getKeys
- Specified by:
getKeys
in interfaceConfiguration
- Returns:
- All keys contained in the configuration.
-
getLong
- Specified by:
getLong
in interfaceConfiguration
-
getLong
- Specified by:
getLong
in interfaceConfiguration
- Returns:
- Long value corresponding to the given key, or the given default value if the target value is null or cannot be coerced to a long.
-
getProperty
- Specified by:
getProperty
in interfaceConfiguration
- Returns:
- Object value corresponding to the given key, or
null
if not set.
-
getString
- Specified by:
getString
in interfaceConfiguration
- Returns:
- String value corresponding to the given key, or
null
if not set.
-
getString
- Specified by:
getString
in interfaceConfiguration
- Returns:
- String value corresponding to the given key, or the given default value if the target value is null.
-
getWrappedConfigurations
- Returns:
- Unmodifiable instance.
-
reload
public void reload()Description copied from interface:Configuration
Reloads the configuration from its persistent store.- Specified by:
reload
in interfaceConfiguration
-
setProperty
- Specified by:
setProperty
in interfaceConfiguration
-