Class InvalidParameterCardinalityException

Object
Throwable
Exception
RuntimeException
IllegalStateException
InvalidParameterCardinalityException
All Implemented Interfaces:
Serializable

public class InvalidParameterCardinalityException extends IllegalStateException
Thrown if adding or removing a parameter value in a group would result in more or less parameters than the expected range. The minimum and maximum occurrences are defined by the ParameterDescriptorGroup instance associated with the ParameterValueGroup.

This exception may be thrown directly by the ParameterValueGroup.addGroup(String) method, or indirectly during the add or remove operations applied on the list returned by ParameterValueGroup.values().

Note 1: the cardinality is the number of elements in a set. Contrast with multiplicity, which is the range of possible cardinalities a set can hold.
Note 2: this exception is of kind IllegalStateException instead of IllegalArgumentException because it is not caused by a bad argument. It is rather a consequence of an ParameterValueGroup being "full".
Since:
2.0
See Also:
  • Constructor Details

    • InvalidParameterCardinalityException

      public InvalidParameterCardinalityException(String message, String parameterName)
      Creates an exception with the specified message and parameter name.
      Parameters:
      message - the detail message, saved for later retrieval by the Throwable.getMessage() method.
      parameterName - the name of the parameter with invalid cardinality.
    • InvalidParameterCardinalityException

      public InvalidParameterCardinalityException(String message, Throwable cause, String parameterName)
      Creates an exception with the specified message, cause and parameter name.
      Parameters:
      message - the detail message, saved for later retrieval by the Throwable.getMessage() method.
      cause - the cause, saved for later retrieval by the Throwable.getCause() method.
      parameterName - the name of the parameter with invalid cardinality.
      Since:
      3.1
  • Method Details

    • getParameterName

      public String getParameterName()
      Returns the name of the parameter with invalid cardinality.
      Returns:
      the name of the parameter with invalid cardinality.