Package org.opengis.parameter
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 theParameterDescriptorGroup
instance associated with theParameterValueGroup
.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 byParameterValueGroup.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 kindIllegalStateException
instead thanIllegalArgumentException
because it is not caused by a bad argument. It is rather a consequence of anParameterValueGroup
being "full".- Since:
- 2.0
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description InvalidParameterCardinalityException(String message, String parameterName)
Creates an exception with the specified message and parameter name.InvalidParameterCardinalityException(String message, Throwable cause, String parameterName)
Creates an exception with the specified message, cause and parameter name.
-
Method Summary
Modifier and Type Method Description String
getParameterName()
Returns the name of the parameter with invalid cardinality.-
Methods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Constructor Detail
-
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 theThrowable.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 theThrowable.getMessage()
method.cause
- the cause, saved for later retrieval by theThrowable.getCause()
method.parameterName
- the name of the parameter with invalid cardinality.- Since:
- 3.1
-
-
Method Detail
-
getParameterName
public String getParameterName()
Returns the name of the parameter with invalid cardinality.- Returns:
- the name of the parameter with invalid cardinality.
-
-