|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Throwable java.lang.Exception java.lang.RuntimeException java.lang.NullPointerException de.smartics.util.lang.NullArgumentException
public class NullArgumentException
Signals that a given argument is 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 passesnull
in some parameter for which null values are prohibited, convention dictates thatNullPointerException
be thrown rather thanIllegalArgumentException
.
Effective Java - Second Edition, p 248
Constructor Summary | |
---|---|
NullArgumentException() Convenience constructor if no argument name needs to be provided. |
|
NullArgumentException(String argName) Convenience constructor. |
|
NullArgumentException(String argName, String message) Default constructor. |
Method Summary |
---|
Methods inherited from class java.lang.Throwable |
---|
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, 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 |
---|
public NullArgumentException()
public NullArgumentException(String argName)
argName
- the name of the argument that was
null
.
public NullArgumentException(String argName, 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(java.lang.String)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |