public final class Preconditions
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static void |
checkArgument(boolean assertion)
Asserts that the given assertion about an argument is true.
|
static <T> T |
checkNotNull(T reference)
Asserts that the given reference is not null.
|
static void |
checkState(boolean assertion)
Asserts that the given assertion about a state is true.
|
public static <T> T checkNotNull(@Nullable
T reference)
reference - A reference that might be nullnulljava.lang.NullPointerException - if the given reference is nullpublic static void checkArgument(boolean assertion)
assertion - The assertion to checkjava.lang.IllegalArgumentException - if the given assertion is falsepublic static void checkState(boolean assertion)
assertion - The assertion to checkjava.lang.IllegalStateException - if the given assertion is false