public class NullArgumentException
extends java.lang.NullPointerException
null where is must no be
null.
Due to Java conventions the exception does not derive from
IllegalArgumentException as one might expect.
If a caller passesnullin some parameter for which null values are prohibited, convention dictates thatNullPointerExceptionbe thrown rather thanIllegalArgumentException.
Effective Java - Second Edition, p 248
| Constructor and Description |
|---|
NullArgumentException()
Convenience constructor if no argument name needs to be provided.
|
NullArgumentException(java.lang.String argName)
Convenience constructor.
|
NullArgumentException(java.lang.String argName,
java.lang.String message)
Default constructor.
|
public NullArgumentException()
public NullArgumentException(java.lang.String argName)
argName - the name of the argument that was null.public NullArgumentException(java.lang.String argName,
java.lang.String message)
argName - the name of the argument that was null.message - an optional additional message to provide information about
the context of the argument.IllegalArgumentException.IllegalArgumentException(String)