接口 ConfigurationPropertySource
- 所有已知实现类:
MapConfigurationPropertySource
- 函数接口:
- 这是一个函数接口, 因此可用作 lambda 表达式或方法引用的赋值目标。
@FunctionalInterface public interface ConfigurationPropertySource
A source ofConfigurationProperties
.
方法概要
所有方法 实例方法 抽象方法 默认方法 修饰符和类型 方法 说明 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.
方法详细资料
getConfigurationProperty
ConfigurationProperty getConfigurationProperty(ConfigurationPropertyName name)
Return a singleConfigurationProperty
from the source ornull
if no property can be found.- 参数:
name
- the name of the property (must not benull
)- 返回:
- 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.- 参数:
name
- the name to check- 返回:
- 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
.- 参数:
filter
- the filter to match- 返回:
- a filtered
ConfigurationPropertySource
instance
withAliases
default ConfigurationPropertySource withAliases(ConfigurationPropertyNameAliases aliases)
Return a variant of this source that supports name aliases.- 参数:
aliases
- a function that returns a stream of aliases for any given name- 返回:
- a
ConfigurationPropertySource
instance supporting name aliases
getUnderlyingSource
default Object getUnderlyingSource()
Return the underlying source that is actually providing the properties.- 返回:
- the underlying property source or
null
.