Class MapConfiguration
java.lang.Object
is.galia.config.MapConfiguration
- All Implemented Interfaces:
Configuration
Implementation backed by a Map.
Mutability and thread safety are dictated by the backing map.
-
Constructor Summary
ConstructorsConstructorDescriptionInitializes an instance with a new empty, mutable, thread-safe backing map.MapConfiguration(Map<String, Object> backingMap) Enables the use of a custom backing map, essentially providing a facade to it. -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clears any key-value pairs from the instance (but not its persistent store, if available).voidclearProperty(String key) Removes a single key-value pair from the instance (but not its persistent store, if available).booleangetBoolean(String key) booleangetBoolean(String key, boolean defaultValue) doubledoublegetFile()floatfloatintintgetKeys()longlonggetProperty(String key) voidreload()No-op.voidsetProperty(String key, Object value) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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
-
Constructor Details
-
MapConfiguration
public MapConfiguration()Initializes an instance with a new empty, mutable, thread-safe backing map. -
MapConfiguration
-
-
Method Details
-
clear
public void clear()Description copied from interface:ConfigurationClears any key-value pairs from the instance (but not its persistent store, if available).- Specified by:
clearin interfaceConfiguration
-
clearProperty
Description copied from interface:ConfigurationRemoves a single key-value pair from the instance (but not its persistent store, if available).- Specified by:
clearPropertyin interfaceConfiguration- Parameters:
key- Key to remove.
-
getBackingMap
-
getBoolean
- Specified by:
getBooleanin interfaceConfiguration
-
getBoolean
- Specified by:
getBooleanin 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:
getDoublein interfaceConfiguration
-
getDouble
- Specified by:
getDoublein 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:
getFilein interfaceConfiguration- Returns:
- The file backing the instance, if any.
-
getFloat
- Specified by:
getFloatin interfaceConfiguration
-
getFloat
- Specified by:
getFloatin 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:
getIntin interfaceConfiguration
-
getInt
- Specified by:
getIntin 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:
getKeysin interfaceConfiguration- Returns:
- All keys contained in the configuration.
-
getLong
- Specified by:
getLongin interfaceConfiguration
-
getLong
- Specified by:
getLongin 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:
getPropertyin interfaceConfiguration- Returns:
- Object value corresponding to the given key, or
nullif not set.
-
getString
- Specified by:
getStringin interfaceConfiguration- Returns:
- String value corresponding to the given key, or
nullif not set.
-
getString
- Specified by:
getStringin interfaceConfiguration- Returns:
- String value corresponding to the given key, or the given default value if the target value is null.
-
reload
-
setProperty
- Specified by:
setPropertyin interfaceConfiguration
-