Interface IterableConfigurationPropertySource
- All Superinterfaces:
ConfigurationPropertySource
,Iterable<ConfigurationPropertyName>
- All Known Implementing Classes:
MapConfigurationPropertySource
public interface IterableConfigurationPropertySource
extends ConfigurationPropertySource, Iterable<ConfigurationPropertyName>
A
ConfigurationPropertySource
with a fully Iterable
set of entries.
Implementations of this interface must be able to iterate over all
contained configuration properties. Any non-null
result from
ConfigurationPropertySource.getConfigurationProperty(ConfigurationPropertyName)
must also have an
equivalent entry in the iterator
.- Since:
- 2.0.0
- Author:
- Phillip Webb, Madhura Bhave
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault ConfigurationPropertyState
Returns if the source contains any descendants of the specified name.filter
(Predicate<ConfigurationPropertyName> filter) Return a filtered variant of this source, containing only names that match the givenPredicate
.default Iterator<ConfigurationPropertyName>
iterator()
Return an iterator for thenames
managed by this source.stream()
Returns a sequentialStream
for thenames
managed by this source.Return a variant of this source that supports name aliases.withPrefix
(String prefix) Return a variant of this source that supports a prefix.Methods inherited from interface org.springframework.boot.context.properties.source.ConfigurationPropertySource
getConfigurationProperty, getUnderlyingSource
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
iterator
Return an iterator for thenames
managed by this source.- Specified by:
iterator
in interfaceIterable<ConfigurationPropertyName>
- Returns:
- an iterator (never
null
)
-
stream
Stream<ConfigurationPropertyName> stream()Returns a sequentialStream
for thenames
managed by this source.- Returns:
- a stream of names (never
null
)
-
containsDescendantOf
Description copied from interface:ConfigurationPropertySource
Returns if the source contains any descendants of the specified name. May returnConfigurationPropertyState.PRESENT
orConfigurationPropertyState.ABSENT
if an answer can be determined orConfigurationPropertyState.UNKNOWN
if it's not possible to determine a definitive answer.- Specified by:
containsDescendantOf
in interfaceConfigurationPropertySource
- Parameters:
name
- the name to check- Returns:
- if the source contains any descendants
-
filter
Description copied from interface:ConfigurationPropertySource
Return a filtered variant of this source, containing only names that match the givenPredicate
.- Specified by:
filter
in interfaceConfigurationPropertySource
- Parameters:
filter
- the filter to match- Returns:
- a filtered
ConfigurationPropertySource
instance
-
withAliases
Description copied from interface:ConfigurationPropertySource
Return a variant of this source that supports name aliases.- Specified by:
withAliases
in interfaceConfigurationPropertySource
- Parameters:
aliases
- a function that returns a stream of aliases for any given name- Returns:
- a
ConfigurationPropertySource
instance supporting name aliases
-
withPrefix
Description copied from interface:ConfigurationPropertySource
Return a variant of this source that supports a prefix.- Specified by:
withPrefix
in interfaceConfigurationPropertySource
- Parameters:
prefix
- the prefix for properties in the source- Returns:
- a
ConfigurationPropertySource
instance supporting a prefix
-