public final class Preconditions extends Object
Modifier and Type | Method and Description |
---|---|
static void |
checkArgument(boolean expression,
String errorMessage)
Ensures the truth of an expression involving one or more parameters to
the calling method.
|
static <T> void |
checkNotNull(T reference,
String msg)
Checks if the reference is null, and if that is the case throws
IllegalArgumentException
|
public static <T> void checkNotNull(T reference, String msg)
reference
- msg
- IllegalArgumentException
- if the reference is nullpublic static void checkArgument(boolean expression, String errorMessage)
expression
- a boolean expressionerrorMessage
- the exception message to use if the check fails;IllegalArgumentException
- if expression
is falseCopyright © 2016 Dexecutor. All rights reserved.