|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atlassian.velocity.htmlsafe.util.Check
public final class Check
Utility to perform checks on parameters.
| Constructor Summary | |
|---|---|
Check()
|
|
| Method Summary | ||
|---|---|---|
static void |
argument(boolean expression)
Ensures the truth of an expression involving one or more parameters to the calling method. |
|
static void |
argument(boolean expression,
java.lang.Object errorMessage)
Ensures the truth of an expression involving one or more parameters to the calling method. |
|
static
|
notNull(T reference)
Check that reference is not null. |
|
static
|
notNull(T reference,
java.lang.Object errorMessage)
Check that reference is not null. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Check()
| Method Detail |
|---|
public static <T> T notNull(T reference)
reference is not null. If it is, throw a
NullPointerException.
reference - reference to check is null or not
reference so it may be used
java.lang.NullPointerException - if reference is null
public static <T> T notNull(T reference,
java.lang.Object errorMessage)
reference is not null. If it is, throw a
NullPointerException.
reference - reference to check is null or noterrorMessage - message passed to the NullPointerException constructor
to give more context when debugging
reference so it may be used
java.lang.NullPointerException - if reference is nullpublic static void argument(boolean expression)
expression - a boolean expression
java.lang.IllegalArgumentException - if expression is false
public static void argument(boolean expression,
java.lang.Object errorMessage)
expression - a boolean expressionerrorMessage - the exception message to use if the check fails; will be
converted to a string using String.valueOf(Object)
java.lang.IllegalArgumentException - if expression is false
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||