public class MapPropertySource extends EnumerablePropertySource<java.util.Map<java.lang.String,java.lang.Object>>
PropertySource
that reads keys and values from a Map
object.PropertiesPropertySource
PropertySource.StubPropertySource
logger, name, source
Constructor and Description |
---|
MapPropertySource(java.lang.String name,
java.util.Map<java.lang.String,java.lang.Object> source) |
Modifier and Type | Method and Description |
---|---|
boolean |
containsProperty(java.lang.String name)
Return whether this
PropertySource contains a property with the given name. |
java.lang.Object |
getProperty(java.lang.String name)
Return the value associated with the given name,
or
null if not found. |
java.lang.String[] |
getPropertyNames()
Return the names of all properties contained by the
source object (never
null ). |
public MapPropertySource(java.lang.String name, java.util.Map<java.lang.String,java.lang.Object> source)
public java.lang.Object getProperty(java.lang.String name)
PropertySource
null
if not found.getProperty
in class PropertySource<java.util.Map<java.lang.String,java.lang.Object>>
name
- the property to findPropertyResolver.getRequiredProperty(String)
public boolean containsProperty(java.lang.String name)
EnumerablePropertySource
PropertySource
contains a property with the given name.
This implementation checks for the presence of the given name within the
EnumerablePropertySource.getPropertyNames()
array.
containsProperty
in class EnumerablePropertySource<java.util.Map<java.lang.String,java.lang.Object>>
name
- the name of the property to findpublic java.lang.String[] getPropertyNames()
EnumerablePropertySource
null
).getPropertyNames
in class EnumerablePropertySource<java.util.Map<java.lang.String,java.lang.Object>>