Class MutuallyExclusiveConfigurationPropertiesException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.springframework.boot.context.properties.source.MutuallyExclusiveConfigurationPropertiesException
- All Implemented Interfaces:
- Serializable
Exception thrown when more than one mutually exclusive configuration property has been
configured.
- Since:
- 2.6.0
- Author:
- Andy Wilkinson, Phillip Webb
- See Also:
- 
Constructor SummaryConstructorsConstructorDescriptionMutuallyExclusiveConfigurationPropertiesException(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.
- 
Method SummaryModifier and TypeMethodDescriptionReturn the names of the properties that have been configured.Return the names of the properties that are mutually exclusive.static <V> voidthrowIfMultipleMatchingValuesIn(Consumer<Map<String, @Nullable V>> entries, Predicate<@Nullable V> predicate) Throw a newMutuallyExclusiveConfigurationPropertiesExceptionif multiple values are defined in a set of entries that match the given predicate.static voidthrowIfMultipleNonNullValuesIn(Consumer<Map<String, @Nullable Object>> entries) Throw a newMutuallyExclusiveConfigurationPropertiesExceptionif multiple non-null values are defined in a set of entries.Methods inherited from class ThrowableaddSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
- 
Constructor Details- 
MutuallyExclusiveConfigurationPropertiesExceptionpublic 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.- Parameters:
- configuredNames- the names of the properties that have been configured
- mutuallyExclusiveNames- the names of the properties that are mutually exclusive
 
 
- 
- 
Method Details- 
getConfiguredNames
- 
getMutuallyExclusiveNames
- 
throwIfMultipleNonNullValuesInThrow a newMutuallyExclusiveConfigurationPropertiesExceptionif multiple non-null values are defined in a set of entries.- Parameters:
- entries- a consumer used to populate the entries to check
 
- 
throwIfMultipleMatchingValuesInpublic static <V> void throwIfMultipleMatchingValuesIn(Consumer<Map<String, @Nullable V>> entries, Predicate<@Nullable V> predicate) Throw a newMutuallyExclusiveConfigurationPropertiesExceptionif multiple values are defined in a set of entries that match the given predicate.- Type Parameters:
- V- the value type
- Parameters:
- entries- a consumer used to populate the entries to check
- predicate- the predicate used to check for matching values
- Since:
- 3.3.7
 
 
-