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
- Author:
- Phillip Webb, Madhura Bhave
-
Constructor Summary
ConstructorsConstructorDescriptionCreate a new emptyMapConfigurationPropertySourceinstance.MapConfigurationPropertySource(Map<?, ?> map) Create a newMapConfigurationPropertySourceinstance with entries copies from the specified map. -
Method Summary
Modifier and TypeMethodDescriptionReturn a singleConfigurationPropertyfrom the source ornullif no property can be found.Return the underlying source that is actually providing the properties.iterator()Return an iterator for thenamesmanaged by this source.voidAdd an individual entry.voidAdd all entries from the specified map.stream()Returns a sequentialStreamfor thenamesmanaged by this source.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface org.springframework.boot.context.properties.source.IterableConfigurationPropertySource
containsDescendantOf, filter, withAliases, withPrefix
-
Constructor Details
-
MapConfigurationPropertySource
public MapConfigurationPropertySource()Create a new emptyMapConfigurationPropertySourceinstance. -
MapConfigurationPropertySource
Create a newMapConfigurationPropertySourceinstance 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:ConfigurationPropertySourceReturn the underlying source that is actually providing the properties.- Specified by:
getUnderlyingSourcein interfaceConfigurationPropertySource- Returns:
- the underlying property source or
null.
-
getConfigurationProperty
Description copied from interface:ConfigurationPropertySourceReturn a singleConfigurationPropertyfrom the source ornullif no property can be found.- Specified by:
getConfigurationPropertyin interfaceConfigurationPropertySource- Parameters:
name- the name of the property (must not benull)- Returns:
- the associated object or
null.
-
iterator
Description copied from interface:IterableConfigurationPropertySourceReturn an iterator for thenamesmanaged by this source.- Specified by:
iteratorin interfaceIterable<ConfigurationPropertyName>- Specified by:
iteratorin interfaceIterableConfigurationPropertySource- Returns:
- an iterator (never
null)
-
stream
Description copied from interface:IterableConfigurationPropertySourceReturns a sequentialStreamfor thenamesmanaged by this source.- Specified by:
streamin interfaceIterableConfigurationPropertySource- Returns:
- a stream of names (never
null)
-