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 PropertiesDelegate
name
- the name of the property; may be null
null
public 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 PropertiesDelegate
null
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 PropertiesDelegate
name
- the name of the property to set; may be null
value
- the value of the property to set; may be null
public final void removeProperty(String name)
removeProperty
in interface PropertiesDelegate
name
- the name of the property to remove; may be null
Copyright © 2019–2020, microBean™. All rights reserved.