Class ConfigurationMap
- java.lang.Object
-
- java.util.AbstractMap<java.lang.Object,java.lang.Object>
-
- org.apache.commons.configuration2.ConfigurationMap
-
- All Implemented Interfaces:
java.util.Map<java.lang.Object,java.lang.Object>
- Direct Known Subclasses:
ConfigurationDynaBean
public class ConfigurationMap extends java.util.AbstractMap<java.lang.Object,java.lang.Object>
The
ConfigurationMap
wraps a configuration-collectionConfiguration
instance to provide aMap
interface.Note: This implementation is incomplete.
- Since:
- 1.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
ConfigurationMap.ConfigurationSet
Sets of entries in the map.
-
Field Summary
Fields Modifier and Type Field Description private Configuration
configuration
TheConfiguration
wrapped by this class.
-
Constructor Summary
Constructors Constructor Description ConfigurationMap(Configuration configuration)
Creates a new instance of aConfigurationMap
that wraps the specifiedConfiguration
instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Set<java.util.Map.Entry<java.lang.Object,java.lang.Object>>
entrySet()
Returns a set with the entries contained in this configuration-based map.java.lang.Object
get(java.lang.Object key)
Gets the value of the specified key.Configuration
getConfiguration()
Gets the wrappedConfiguration
object.java.lang.Object
put(java.lang.Object key, java.lang.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
-
-
-
-
Field Detail
-
configuration
private final Configuration configuration
TheConfiguration
wrapped by this class.
-
-
Constructor Detail
-
ConfigurationMap
public ConfigurationMap(Configuration configuration)
Creates a new instance of aConfigurationMap
that wraps the specifiedConfiguration
instance.- Parameters:
configuration
-Configuration
instance.
-
-
Method Detail
-
entrySet
public java.util.Set<java.util.Map.Entry<java.lang.Object,java.lang.Object>> entrySet()
Returns a set with the entries contained in this configuration-based map.- Specified by:
entrySet
in interfacejava.util.Map<java.lang.Object,java.lang.Object>
- Specified by:
entrySet
in classjava.util.AbstractMap<java.lang.Object,java.lang.Object>
- Returns:
- a set with the contained entries
- See Also:
Map.entrySet()
-
get
public java.lang.Object get(java.lang.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:
get
in interfacejava.util.Map<java.lang.Object,java.lang.Object>
- Overrides:
get
in classjava.util.AbstractMap<java.lang.Object,java.lang.Object>
- Parameters:
key
- the key- Returns:
- the value of this key
- See Also:
Map.get(Object)
-
getConfiguration
public Configuration getConfiguration()
Gets the wrappedConfiguration
object.- Returns:
- the wrapped configuration
- Since:
- 1.2
-
put
public java.lang.Object put(java.lang.Object key, java.lang.Object value)
Stores the value for the specified key. The value is stored in the underlying configuration.- Specified by:
put
in interfacejava.util.Map<java.lang.Object,java.lang.Object>
- Overrides:
put
in classjava.util.AbstractMap<java.lang.Object,java.lang.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)
-
-