Class ConfigurationMap
- java.lang.Object
-
- java.util.AbstractMap<Object,Object>
-
- org.apache.commons.configuration2.ConfigurationMap
-
- Direct Known Subclasses:
ConfigurationDynaBean
public class ConfigurationMap extends AbstractMap<Object,Object>
The
ConfigurationMapwraps a configuration-collectionConfigurationinstance to provide aMapinterface.Note: This implementation is incomplete.
- Since:
- 1.0
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object,V extends Object>
-
-
Constructor Summary
Constructors Constructor Description ConfigurationMap(Configuration configuration)Creates a new instance of aConfigurationMapthat wraps the specifiedConfigurationinstance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<Map.Entry<Object,Object>>entrySet()Returns a set with the entries contained in this configuration-based map.Objectget(Object key)Gets the value of the specified key.ConfigurationgetConfiguration()Gets the wrappedConfigurationobject.Objectput(Object key, Object value)Stores the value for the specified key.-
Methods inherited from class java.util.AbstractMap
clear, clone, containsKey, containsValue, equals, hashCode, isEmpty, keySet, putAll, remove, size, toString, values
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
-
-
-
Constructor Detail
-
ConfigurationMap
public ConfigurationMap(Configuration configuration)
Creates a new instance of aConfigurationMapthat wraps the specifiedConfigurationinstance.- Parameters:
configuration-Configurationinstance.
-
-
Method Detail
-
getConfiguration
public Configuration getConfiguration()
Gets the wrappedConfigurationobject.- Returns:
- the wrapped configuration
- Since:
- 1.2
-
entrySet
public Set<Map.Entry<Object,Object>> entrySet()
Returns a set with the entries contained in this configuration-based map.- Specified by:
entrySetin interfaceMap<Object,Object>- Specified by:
entrySetin classAbstractMap<Object,Object>- Returns:
- a set with the contained entries
- See Also:
Map.entrySet()
-
put
public Object put(Object key, Object value)
Stores the value for the specified key. The value is stored in the underlying configuration.- Specified by:
putin interfaceMap<Object,Object>- Overrides:
putin classAbstractMap<Object,Object>- Parameters:
key- the key (will be converted to a string)value- the value- Returns:
- the old value of this key or null if it is new
- See Also:
Map.put(Object, Object)
-
get
public Object get(Object key)
Gets the value of the specified key. The key is converted to a string and then passed to the underlying configuration.- Specified by:
getin interfaceMap<Object,Object>- Overrides:
getin classAbstractMap<Object,Object>- Parameters:
key- the key- Returns:
- the value of this key
- See Also:
Map.get(Object)
-
-