com.croftsoft.core.lang
Class NullArgumentException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by java.lang.IllegalArgumentException
                  extended by 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

Constructor Summary
NullArgumentException()
           
NullArgumentException(String detailMessage)
           
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NullArgumentException

public NullArgumentException()

NullArgumentException

public NullArgumentException(String detailMessage)
Method Detail

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 Javadoc

CroftSoft Core Javadoc (2008-09-28 20:58:02)