public class ArgumentNullException extends ArgumentException
Constructor and Description |
---|
ArgumentNullException()
Initializes a new instance.
|
ArgumentNullException(String paramName)
Initializes a new instance with the name of the parameter that causes this
exception.
|
ArgumentNullException(String message,
Exception cause)
Initializes a new instance with a specified error message and the exception that is
the cause of this exception.
|
ArgumentNullException(String paramName,
String message)
Initializes an instance with a specified error message and the name of the
parameter that causes this exception.
|
Modifier and Type | Method and Description |
---|---|
static <T> void |
assertNonNull(T value,
String paramName)
Checks that the specified object reference is not
null and throws a
ArgumentNullException with the specified paramName if it is. |
getMessage, getParamName
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
public ArgumentNullException()
public ArgumentNullException(String paramName)
paramName
- The name of the parameter that caused the exception.public ArgumentNullException(String message, Exception cause)
message
- The error message that explains the reason for this exception.cause
- The exception that is the cause of the current exception, or a null
reference if no inner exception is specified.public ArgumentNullException(String paramName, String message)
paramName
- The name of the parameter that caused the exception.message
- A message that describes the error.public static <T> void assertNonNull(T value, String paramName)
null
and throws a
ArgumentNullException
with the specified paramName
if it is.T
- The type of value
.value
- The object to check.paramName
- The name of the parameter that is being checked.ArgumentNullException
- Thrown when value
is null
.