- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- java.lang.IllegalArgumentException
-
- com.aoapps.lang.NullArgumentException
-
- All Implemented Interfaces:
Serializable
public class NullArgumentException extends IllegalArgumentException
Indicates a null argument was passed where not allowed.- Author:
- AO Industries, Inc.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description NullArgumentException(String argument)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> TcheckNotNull(T argument)Checks an argument and throws an exception if null.static <T> TcheckNotNull(T argument, String argumentName)Checks an argument and throws an exception if null.StringgetArgument()Gets the name of the argument that was null.StringgetLocalizedMessage()-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Constructor Detail
-
NullArgumentException
public NullArgumentException(String argument)
-
-
Method Detail
-
checkNotNull
public static <T> T checkNotNull(T argument) throws NullArgumentExceptionChecks an argument and throws an exception if null.- Throws:
NullArgumentException
-
checkNotNull
public static <T> T checkNotNull(T argument, String argumentName) throws NullArgumentExceptionChecks an argument and throws an exception if null.- Throws:
NullArgumentException
-
getLocalizedMessage
public String getLocalizedMessage()
- Overrides:
getLocalizedMessagein classThrowable
-
getArgument
public String getArgument()
Gets the name of the argument that was null.
-
-