类 MutuallyExclusiveConfigurationPropertiesException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.springframework.boot.context.properties.source.MutuallyExclusiveConfigurationPropertiesException
- 所有已实现的接口:
Serializable
Exception thrown when more than one mutually exclusive configuration property has been
configured.
- 从以下版本开始:
- 2.6.0
- 作者:
- Andy Wilkinson, Phillip Webb
- 另请参阅:
-
构造器概要
构造器构造器说明MutuallyExclusiveConfigurationPropertiesException
(Collection<String> configuredNames, Collection<String> mutuallyExclusiveNames) Creates a new instance for mutually exclusive configuration properties when two or more of those properties have been configured. -
方法概要
修饰符和类型方法说明Return the names of the properties that have been configured.Return the names of the properties that are mutually exclusive.static <V> void
throwIfMultipleMatchingValuesIn
(Consumer<Map<String, V>> entries, Predicate<V> predicate) Throw a newMutuallyExclusiveConfigurationPropertiesException
if multiple values are defined in a set of entries that match the given predicate.static void
throwIfMultipleNonNullValuesIn
(Consumer<Map<String, Object>> entries) Throw a newMutuallyExclusiveConfigurationPropertiesException
if multiple non-null values are defined in a set of entries.
-
构造器详细资料
-
MutuallyExclusiveConfigurationPropertiesException
public MutuallyExclusiveConfigurationPropertiesException(Collection<String> configuredNames, Collection<String> mutuallyExclusiveNames) Creates a new instance for mutually exclusive configuration properties when two or more of those properties have been configured.- 参数:
configuredNames
- the names of the properties that have been configuredmutuallyExclusiveNames
- the names of the properties that are mutually exclusive
-
-
方法详细资料
-
getConfiguredNames
Return the names of the properties that have been configured.- 返回:
- the names of the configured properties
-
getMutuallyExclusiveNames
Return the names of the properties that are mutually exclusive.- 返回:
- the names of the mutually exclusive properties
-
throwIfMultipleNonNullValuesIn
Throw a newMutuallyExclusiveConfigurationPropertiesException
if multiple non-null values are defined in a set of entries.- 参数:
entries
- a consumer used to populate the entries to check
-
throwIfMultipleMatchingValuesIn
public static <V> void throwIfMultipleMatchingValuesIn(Consumer<Map<String, V>> entries, Predicate<V> predicate) Throw a newMutuallyExclusiveConfigurationPropertiesException
if multiple values are defined in a set of entries that match the given predicate.- 类型参数:
V
- the value type- 参数:
entries
- a consumer used to populate the entries to checkpredicate
- the predicate used to check for matching values- 从以下版本开始:
- 3.3.7
-