org.specrunner.configuration.core
Class ConfigurationImpl

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by java.util.HashMap<String,Object>
          extended by org.specrunner.configuration.core.ConfigurationImpl
All Implemented Interfaces:
Serializable, Cloneable, Map<String,Object>, IConfiguration

public class ConfigurationImpl
extends HashMap<String,Object>
implements IConfiguration

Default implementation.

Author:
Thiago Santos
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Constructor Summary
ConfigurationImpl()
           
 
Method Summary
 IConfiguration add(String feature, Object value)
          Add a feature to the configuration.
 Object get(String feature, Object defaultValue)
          Get a value from map, if not found, result is 'defaultValue'.
 
Methods inherited from class java.util.HashMap
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values
 
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values
 

Constructor Detail

ConfigurationImpl

public ConfigurationImpl()
Method Detail

add

public IConfiguration add(String feature,
                          Object value)
Description copied from interface: IConfiguration
Add a feature to the configuration.

Specified by:
add in interface IConfiguration
Parameters:
feature - The feature name.
value - The feature value.
Returns:
The configuration itself.

get

public Object get(String feature,
                  Object defaultValue)
Description copied from interface: IConfiguration
Get a value from map, if not found, result is 'defaultValue'.

Specified by:
get in interface IConfiguration
Parameters:
feature - A name.
defaultValue - The default value.
Returns:
The key value, or defaultValue, if not found.


Copyright © 2014. All rights reserved.