org.springframework.boot.context.properties.source

Class MutuallyExclusiveConfigurationPropertiesException

  • java.lang.Object
    • java.lang.Throwable
      • java.lang.Exception
        • java.lang.RuntimeException
          • org.springframework.boot.context.properties.source.MutuallyExclusiveConfigurationPropertiesException
  • All Implemented Interfaces:
    java.io.Serializable


    public class MutuallyExclusiveConfigurationPropertiesException
    extends java.lang.RuntimeException
    Exception thrown when more than one mutually exclusive configuration property has been configured.
    Since:
    2.6.0
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      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.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      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.
      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • MutuallyExclusiveConfigurationPropertiesException

        public 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.
        Parameters:
        configuredNames - the names of the properties that have been configured
        mutuallyExclusiveNames - the names of the properties that are mutually exclusive
    • Method Detail

      • getConfiguredNames

        public java.util.Set<java.lang.String> getConfiguredNames()
        Return the names of the properties that have been configured.
        Returns:
        the names of the configured properties
      • getMutuallyExclusiveNames

        public java.util.Set<java.lang.String> getMutuallyExclusiveNames()
        Return the names of the properties that are mutually exclusive.
        Returns:
        the names of the mutually exclusive properties
      • throwIfMultipleNonNullValuesIn

        public 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.
        Parameters:
        entries - a consumer used to populate the entries to check