com.croftsoft.core.lang
Class NullArgumentException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
java.lang.IllegalArgumentException
com.croftsoft.core.lang.NullArgumentException
- All Implemented Interfaces:
- Serializable
public final class NullArgumentException
- extends IllegalArgumentException
Thrown to indicate that a method has been passed a null argument.
The static convenience method check() is a useful shorthand
notation for checking whether object constructor method arguments
are null:
public Book ( String title )
{
NullArgumentException.check ( this.title = title, "null title" );
}
- Since:
- 2001-02-16
- Version:
- $Date: 2008/02/10 22:53:21 $
- See Also:
- Serialized Form
- Author:
- David Wallace Croft
Method Summary |
static void |
check(Object argument)
Checks whether the argument is null. |
static void |
check(Object argument,
String detailMessage)
Checks whether the argument is null. |
static void |
checkArgs(Object... args)
|
Methods inherited from class java.lang.Throwable |
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
NullArgumentException
public NullArgumentException()
NullArgumentException
public NullArgumentException(String detailMessage)
check
public static void check(Object argument)
- Checks whether the argument is null.
- Throws:
NullArgumentException
- If the argument is null.
check
public static void check(Object argument,
String detailMessage)
- Checks whether the argument is null.
- Parameters:
detailMessage
- The detail message provided if a NullArgumentExcepton is created.
- Throws:
NullArgumentException
- If the argument is null.
checkArgs
public static void checkArgs(Object... args)
CroftSoft Core Javadoc (2008-09-28 20:58:02)