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
- See Also:
-
Constructor Summary
ConstructorDescriptionMutuallyExclusiveConfigurationPropertiesException
(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 Summary
Modifier and TypeMethodDescriptionReturn the names of the properties that have been configured.Return the names of the properties that are mutually exclusive.static void
throwIfMultipleNonNullValuesIn
(Consumer<Map<String, Object>> entries) Throw a newMutuallyExclusiveConfigurationPropertiesException
if multiple non-null values are defined in a set of entries.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
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.- Parameters:
configuredNames
- the names of the properties that have been configuredmutuallyExclusiveNames
- the names of the properties that are mutually exclusive
-
-
Method Details
-
getConfiguredNames
Return the names of the properties that have been configured.- Returns:
- the names of the configured properties
-
getMutuallyExclusiveNames
Return the names of the properties that are mutually exclusive.- Returns:
- the names of the mutually exclusive properties
-
throwIfMultipleNonNullValuesIn
Throw a newMutuallyExclusiveConfigurationPropertiesException
if multiple non-null values are defined in a set of entries.- Parameters:
entries
- a consumer used to populate the entries to check
-