Package org.apache.commons.lang
Class NullArgumentException
- java.lang.Object
 - 
- java.lang.Throwable
 - 
- java.lang.Exception
 - 
- java.lang.RuntimeException
 - 
- java.lang.IllegalArgumentException
 - 
- org.apache.commons.lang.NullArgumentException
 
 
 
 
 
 
- 
- All Implemented Interfaces:
 java.io.Serializable
public class NullArgumentException extends java.lang.IllegalArgumentExceptionThrown to indicate that an argument was
nulland should not have been. This exception supplements the standardIllegalArgumentExceptionby providing a more semantically rich description of the problem.NullArgumentExceptionrepresents the case where a method takes in a parameter that must not benull. Some coding standards would useNullPointerExceptionfor this case, others will useIllegalArgumentException. Thus this exception would be used in place ofIllegalArgumentException, yet it still extends it.public void foo(String str) { if (str == null) { throw new NullArgumentException("str"); } // do something with the string }- Since:
 - 2.0
 - See Also:
 - Serialized Form
 
 
- 
- 
Constructor Summary
Constructors Constructor Description NullArgumentException(java.lang.String argName)Instantiates with the given argument name. 
 -