Interface ConfigurationPropertySource
- All Known Subinterfaces:
IterableConfigurationPropertySource
- All Known Implementing Classes:
MapConfigurationPropertySource
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface ConfigurationPropertySource
A source ofConfigurationProperties
.- Since:
- 2.0.0
- See Also:
ConfigurationPropertyName
,OriginTrackedValue
,getConfigurationProperty(ConfigurationPropertyName)
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default ConfigurationPropertyState
containsDescendantOf(ConfigurationPropertyName name)
Returns if the source contains any descendants of the specified name.default ConfigurationPropertySource
filter(Predicate<ConfigurationPropertyName> filter)
Return a filtered variant of this source, containing only names that match the givenPredicate
.ConfigurationProperty
getConfigurationProperty(ConfigurationPropertyName name)
Return a singleConfigurationProperty
from the source ornull
if no property can be found.default Object
getUnderlyingSource()
Return the underlying source that is actually providing the properties.default ConfigurationPropertySource
withAliases(ConfigurationPropertyNameAliases aliases)
Return a variant of this source that supports name aliases.
Method Detail
getConfigurationProperty
ConfigurationProperty getConfigurationProperty(ConfigurationPropertyName name)
Return a singleConfigurationProperty
from the source ornull
if no property can be found.- Parameters:
name
- the name of the property (must not benull
)- Returns:
- the associated object or
null
.
containsDescendantOf
default ConfigurationPropertyState containsDescendantOf(ConfigurationPropertyName name)
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.- Parameters:
name
- the name to check- Returns:
- if the source contains any descendants
filter
default ConfigurationPropertySource filter(Predicate<ConfigurationPropertyName> filter)
Return a filtered variant of this source, containing only names that match the givenPredicate
.- Parameters:
filter
- the filter to match- Returns:
- a filtered
ConfigurationPropertySource
instance
withAliases
default ConfigurationPropertySource withAliases(ConfigurationPropertyNameAliases aliases)
Return a variant of this source that supports name aliases.- Parameters:
aliases
- a function that returns a stream of aliases for any given name- Returns:
- a
ConfigurationPropertySource
instance supporting name aliases
getUnderlyingSource
default Object getUnderlyingSource()
Return the underlying source that is actually providing the properties.- Returns:
- the underlying property source or
null
.