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, V>> entries, Predicate<V> predicate) Throw a newMutuallyExclusiveConfigurationPropertiesExceptionif multiple values are defined in a set of entries that match the given predicate.static voidthrowIfMultipleNonNullValuesIn(Consumer<Map<String, Object>> entries) Throw a newMutuallyExclusiveConfigurationPropertiesExceptionif multiple non-null values are defined in a set of entries.Methods inherited from class java.lang.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- 
getConfiguredNamesReturn the names of the properties that have been configured.- Returns:
- the names of the configured properties
 
- 
getMutuallyExclusiveNamesReturn the names of the properties that are mutually exclusive.- Returns:
- the names of the mutually exclusive properties
 
- 
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, V>> entries, Predicate<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
 
 
-