public class NullCheckingUtil
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
NullCheckingUtil.NullCheckResult
Represents null value returned by
findNull(Object...). |
| Constructor and Description |
|---|
NullCheckingUtil() |
| Modifier and Type | Method and Description |
|---|---|
static void |
badStateIfNull(java.lang.Object valueToCheck,
java.lang.String msg)
This method throw an IllegalStateException if the given parameter is null
|
static void |
badStateIfTrue(boolean valueToCheck,
java.lang.String msg)
This method throw an IllegalStateException if the given parameter is true
|
static void |
checkArgsNotNull(java.lang.Object... params)
Check that the given parameters are not null.
|
static NullCheckingUtil.NullCheckResult |
findNull(java.lang.Object... params)
Find null parameters in the given list.
|
static java.lang.StackTraceElement |
getCaller(int offset)
Return the StackTraceElement at the given offset from this method
invocation.
|
public static void checkArgsNotNull(java.lang.Object... params)
params - the parameters to checkjava.lang.IllegalArgumentException - if at least one of the parameters is nullpublic static NullCheckingUtil.NullCheckResult findNull(java.lang.Object... params)
NullCheckingUtil.NullCheckResult.params - the parameters to checkNullCheckingUtil.NullCheckResult representing null parameters.NullCheckingUtil.NullCheckResultpublic static java.lang.StackTraceElement getCaller(int offset)
offset - public static void badStateIfNull(java.lang.Object valueToCheck,
java.lang.String msg)
valueToCheck - the value to checkmsg - the message for the thrown exceptionIllegalStateExceptionpublic static void badStateIfTrue(boolean valueToCheck,
java.lang.String msg)
valueToCheck - the value to checkmsg - the message for the thrown exceptionIllegalStateException