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 ConfigurationPropertyStateReturns 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 thenamesmanaged by this source.stream()Returns a sequentialStreamfor thenamesmanaged by this source.Return a variant of this source that supports name aliases.withPrefix(@Nullable String prefix) Return a variant of this source that supports a prefix.Methods inherited from interface ConfigurationPropertySource
getConfigurationProperty, getUnderlyingSourceMethods inherited from interface Iterable
forEach, spliterator
-
Method Details
-
iterator
Return an iterator for thenamesmanaged by this source.- Specified by:
iteratorin interfaceIterable<ConfigurationPropertyName>- Returns:
- an iterator (never
null)
-
stream
Stream<ConfigurationPropertyName> stream()Returns a sequentialStreamfor thenamesmanaged by this source.- Returns:
- a stream of names (never
null)
-
containsDescendantOf
Description copied from interface:ConfigurationPropertySourceReturns if the source contains any descendants of the specified name. May returnConfigurationPropertyState.PRESENTorConfigurationPropertyState.ABSENTif an answer can be determined orConfigurationPropertyState.UNKNOWNif it's not possible to determine a definitive answer.- Specified by:
containsDescendantOfin interfaceConfigurationPropertySource- Parameters:
name- the name to check- Returns:
- if the source contains any descendants
-
filter
Description copied from interface:ConfigurationPropertySourceReturn a filtered variant of this source, containing only names that match the givenPredicate.- Specified by:
filterin interfaceConfigurationPropertySource- Parameters:
filter- the filter to match- Returns:
- a filtered
ConfigurationPropertySourceinstance
-
withAliases
Description copied from interface:ConfigurationPropertySourceReturn a variant of this source that supports name aliases.- Specified by:
withAliasesin interfaceConfigurationPropertySource- Parameters:
aliases- a function that returns a stream of aliases for any given name- Returns:
- a
ConfigurationPropertySourceinstance supporting name aliases
-
withPrefix
Description copied from interface:ConfigurationPropertySourceReturn a variant of this source that supports a prefix.- Specified by:
withPrefixin interfaceConfigurationPropertySource- Parameters:
prefix- the prefix for properties in the source- Returns:
- a
ConfigurationPropertySourceinstance supporting a prefix
-