Class MapConfigurationPropertySource
java.lang.Object
org.springframework.boot.context.properties.source.MapConfigurationPropertySource
- All Implemented Interfaces:
Iterable<ConfigurationPropertyName>
,ConfigurationPropertySource
,IterableConfigurationPropertySource
public class MapConfigurationPropertySource
extends Object
implements IterableConfigurationPropertySource
A
ConfigurationPropertySource
backed by a Map
and using standard name
mapping rules.- Since:
- 2.0.0
-
Constructor Summary
ConstructorDescriptionCreate a new emptyMapConfigurationPropertySource
instance.MapConfigurationPropertySource
(Map<?, ?> map) Create a newMapConfigurationPropertySource
instance with entries copies from the specified map. -
Method Summary
Modifier and TypeMethodDescriptionReturn a singleConfigurationProperty
from the source ornull
if no property can be found.Return the underlying source that is actually providing the properties.iterator()
Return an iterator for thenames
managed by this source.void
Add an individual entry.void
Add all entries from the specified map.stream()
Returns a sequentialStream
for thenames
managed by this source.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
Methods inherited from interface org.springframework.boot.context.properties.source.IterableConfigurationPropertySource
containsDescendantOf, filter, withAliases, withPrefix
-
Constructor Details
-
MapConfigurationPropertySource
public MapConfigurationPropertySource()Create a new emptyMapConfigurationPropertySource
instance. -
MapConfigurationPropertySource
Create a newMapConfigurationPropertySource
instance with entries copies from the specified map.- Parameters:
map
- the source map
-
-
Method Details
-
putAll
Add all entries from the specified map.- Parameters:
map
- the source map
-
put
Add an individual entry.- Parameters:
name
- the namevalue
- the value
-
getUnderlyingSource
Description copied from interface:ConfigurationPropertySource
Return the underlying source that is actually providing the properties.- Specified by:
getUnderlyingSource
in interfaceConfigurationPropertySource
- Returns:
- the underlying property source or
null
.
-
getConfigurationProperty
Description copied from interface:ConfigurationPropertySource
Return a singleConfigurationProperty
from the source ornull
if no property can be found.- Specified by:
getConfigurationProperty
in interfaceConfigurationPropertySource
- Parameters:
name
- the name of the property (must not benull
)- Returns:
- the associated object or
null
.
-
iterator
Description copied from interface:IterableConfigurationPropertySource
Return an iterator for thenames
managed by this source.- Specified by:
iterator
in interfaceIterable<ConfigurationPropertyName>
- Specified by:
iterator
in interfaceIterableConfigurationPropertySource
- Returns:
- an iterator (never
null
)
-
stream
Description copied from interface:IterableConfigurationPropertySource
Returns a sequentialStream
for thenames
managed by this source.- Specified by:
stream
in interfaceIterableConfigurationPropertySource
- Returns:
- a stream of names (never
null
)
-