info.aduna.lang
Class VarargsNullValueException

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 info.aduna.lang.VarargsNullValueException
All Implemented Interfaces:
Serializable

public class VarargsNullValueException
extends IllegalArgumentException

Extension of IllegalArgumentException indicating that a null value has been supplied as the value of a vararg parameter to a method that expects a non-null value. A common cause of this problem is when null is used in a method call without a cast to the vararg's element type. By default, the Java compiler will interpret the null value to an array of the vararg's element type.

Author:
Herko ter Horst, Arjohn Kampman
See Also:
Serialized Form

Constructor Summary
VarargsNullValueException()
          Construct a new VarargsNullValueException with a default message intended to explain the most likely fix for this exception.
VarargsNullValueException(String s)
           
 
Method Summary
static
<E> void
throwIfNull(E... vararg)
          Throws a VarargsNullValueException if the supplied argument is null.
 
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

VarargsNullValueException

public VarargsNullValueException()
Construct a new VarargsNullValueException with a default message intended to explain the most likely fix for this exception.


VarargsNullValueException

public VarargsNullValueException(String s)
Method Detail

throwIfNull

public static <E> void throwIfNull(E... vararg)
                        throws VarargsNullValueException
Throws a VarargsNullValueException if the supplied argument is null.

Throws:
VarargsNullValueException


Copyright © 1997-2008 Aduna. All Rights Reserved.