public class MapBackedPropertiesDelegate extends Object implements PropertiesDelegate
PropertiesDelegate built around a Map.
Instances of this class are not safe for concurrent use by multiple threads.
PropertiesDelegate| Constructor and Description |
|---|
MapBackedPropertiesDelegate()
Creates a new
MapBackedPropertiesDelegate. |
MapBackedPropertiesDelegate(Map<String,Object> map)
Creates a new
MapBackedPropertiesDelegate. |
| Modifier and Type | Method and Description |
|---|---|
Object |
getProperty(String name)
Returns the property value indexed under the supplied
name, or null if the property value is itself null or if no such property exists. |
Collection<String> |
getPropertyNames()
Returns a
Collection of the names of properties that this
MapBackedPropertiesDelegate stores. |
void |
removeProperty(String name)
Removes any property value indexed under the supplied property
name.
|
void |
setProperty(String name,
Object value)
Sets the supplied
value as the property value to be
indexed under the supplied name. |
public MapBackedPropertiesDelegate()
MapBackedPropertiesDelegate.MapBackedPropertiesDelegate(Map)public MapBackedPropertiesDelegate(Map<String,Object> map)
MapBackedPropertiesDelegate.map - the Map implementing this MapBackedPropertiesDelegate; may be null in which case a
new HashMap will be used
instead; accessed by referencepublic final Object getProperty(String name)
name, or null if the property value is itself null or if no such property exists.
This method may return null.
getProperty in interface PropertiesDelegatename - the name of the property; may be nullnullpublic final Collection<String> getPropertyNames()
Collection of the names of properties that this
MapBackedPropertiesDelegate stores.
This method never returns null.
The order of the elements of the returned Collection
is deliberately unspecified, is subject to change, and must not
be relied upon.
getPropertyNames in interface PropertiesDelegatenull Collection of property namespublic final void setProperty(String name, Object value)
value as the property value to be
indexed under the supplied name.setProperty in interface PropertiesDelegatename - the name of the property to set; may be nullvalue - the value of the property to set; may be nullpublic final void removeProperty(String name)
removeProperty in interface PropertiesDelegatename - the name of the property to remove; may be nullCopyright © 2019–2020, microBean™. All rights reserved.