public class MapPropertySource extends Object implements PropertySource
PropertySource
that uses a map.PropertySource.PropertyConvention
CONTEXT
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor and Description |
---|
MapPropertySource(String name,
Map map)
Creates a map property source.
|
Modifier and Type | Method and Description |
---|---|
Map<String,Object> |
asMap()
The backing map (unmodifiable).
|
Object |
get(String key)
Get a property value of the given key.
|
String |
getName() |
Iterator<String> |
iterator() |
static MapPropertySource |
of(String name,
Map<String,Object> map)
Create a new
MapPropertySource from the given map. |
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getConvention, mapOf, of, of, of, of
forEach, spliterator
public String getName()
getName
in interface PropertySource
public Object get(String key)
PropertySource
get
in interface PropertySource
key
- The keypublic static MapPropertySource of(String name, Map<String,Object> map)
MapPropertySource
from the given map.of
in interface PropertySource
name
- The name of the property sourcemap
- The map