public class MutuallyExclusiveConfigurationPropertiesException
extends java.lang.RuntimeException
Constructor and Description |
---|
MutuallyExclusiveConfigurationPropertiesException(java.util.Collection<java.lang.String> configuredNames,
java.util.Collection<java.lang.String> mutuallyExclusiveNames)
Creates a new instance for mutually exclusive configuration properties when two or
more of those properties have been configured.
|
Modifier and Type | Method and Description |
---|---|
java.util.Set<java.lang.String> |
getConfiguredNames()
Return the names of the properties that have been configured.
|
java.util.Set<java.lang.String> |
getMutuallyExclusiveNames()
Return the names of the properties that are mutually exclusive.
|
static void |
throwIfMultipleNonNullValuesIn(java.util.function.Consumer<java.util.Map<java.lang.String,java.lang.Object>> entries)
Throw a new
MutuallyExclusiveConfigurationPropertiesException if multiple
non-null values are defined in a set of entries. |
public MutuallyExclusiveConfigurationPropertiesException(java.util.Collection<java.lang.String> configuredNames, java.util.Collection<java.lang.String> mutuallyExclusiveNames)
configuredNames
- the names of the properties that have been configuredmutuallyExclusiveNames
- the names of the properties that are mutually
exclusivepublic java.util.Set<java.lang.String> getConfiguredNames()
public java.util.Set<java.lang.String> getMutuallyExclusiveNames()
public static void throwIfMultipleNonNullValuesIn(java.util.function.Consumer<java.util.Map<java.lang.String,java.lang.Object>> entries)
MutuallyExclusiveConfigurationPropertiesException
if multiple
non-null values are defined in a set of entries.entries
- a consumer used to populate the entries to check