public class FeatureManagerImpl extends HashMap<String,Object> implements IFeatureManager
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>| Modifier and Type | Field and Description |
|---|---|
protected IConfiguration |
configuration
The current configuration.
|
protected Map<String,Boolean> |
overrides
Set of overrides information.
|
| Constructor and Description |
|---|
FeatureManagerImpl() |
| Modifier and Type | Method and Description |
|---|---|
IFeatureManager |
add(String key,
Object value)
Set a feature to a value.
|
IFeatureManager |
add(String key,
Object value,
boolean override)
Set a feature to a value.
|
boolean |
containsKey(Object key) |
Object |
get(Object key) |
Object |
get(String key,
Object defaultValue)
Get a value from map, if not found, result is 'defaultValue'.
|
IConfiguration |
getConfiguration()
Get configuration.
|
protected String |
getField(String feature)
Recover the property name for the feature.
|
Object |
put(String key,
Object value) |
void |
set(String feature,
Object target)
Sets a feature to an object if the feature exists and the type is
compatible.
|
void |
setConfiguration(IConfiguration configuration)
Set a set of local configuration as complementary information to feature
settings.
|
void |
setStrict(String feature,
Object target)
Sets a feature to an object if the feature exists and the type is
compatible.
|
protected void |
setValue(String feature,
Object value,
Object target,
String field,
IAccess access)
Set the value.
|
clear, clone, containsValue, entrySet, isEmpty, keySet, putAll, remove, size, valuesequals, hashCode, toStringprotected IConfiguration configuration
public IFeatureManager add(String key, Object value)
IFeatureManageradd in interface IFeatureManagerkey - The feature name.value - The value.public IFeatureManager add(String key, Object value, boolean override)
IFeatureManageradd in interface IFeatureManagerkey - The feature name.value - The value.override - true, if the value should overwrite previous values, false,
otherwise.public boolean containsKey(Object key)
containsKey in interface Map<String,Object>containsKey in class HashMap<String,Object>public void set(String feature, Object target)
IFeatureManagerset in interface IFeatureManagerfeature - The feature name.target - The object where the feature must be set.public void setStrict(String feature, Object target) throws FeatureManagerException
IFeatureManagersetStrict in interface IFeatureManagerfeature - The feature name.target - The object where the feature must be set.FeatureManagerException - On object setup.protected String getField(String feature) throws FeatureManagerException
feature - The feature name.FeatureManagerException - On field name recovery errors.protected void setValue(String feature, Object value, Object target, String field, IAccess access) throws FeatureManagerException
feature - The feature name.value - The feature value.target - The target object.field - The target field.access - The field access.FeatureManagerException - On setting error.public void setConfiguration(IConfiguration configuration)
IFeatureManagerISpecRunner received a
IConfiguration, this is set here as local and at the
beginning of a new test execution it can be just replaced.setConfiguration in interface IFeatureManagerconfiguration - Set configuration features.public IConfiguration getConfiguration()
IFeatureManagergetConfiguration in interface IFeatureManagerpublic Object get(String key, Object defaultValue)
IFeatureManagerget in interface IFeatureManagerkey - A name.defaultValue - The default value.Copyright © 2016. All rights reserved.