public class Preconditions2 extends Object
com.google.common.base.Preconditions| Constructor and Description |
|---|
Preconditions2() |
| Modifier and Type | Method and Description |
|---|---|
static void |
checkArgument(boolean expression) |
static void |
checkArgument(boolean expression,
String msg) |
static void |
checkArgument(boolean expression,
String msgFormat,
Object... msgArgs) |
static String |
checkNotEmpty(String str) |
static <T> T |
checkNotNull(T t) |
static <T> T |
checkNotNull(T reference,
String message)
Check the nullity of the given
reference. |
public static <T> T checkNotNull(T t)
public static <T> T checkNotNull(T reference,
@Nullable
String message)
throws NullPointerException
reference.reference - reference to checkmessage - exception message, can be nullreferenceNullPointerException - if the given reference is nullpublic static void checkArgument(boolean expression)
throws IllegalArgumentException
IllegalArgumentExceptionpublic static void checkArgument(boolean expression,
@Nullable
String msg)
throws IllegalArgumentException
IllegalArgumentExceptionpublic static void checkArgument(boolean expression,
@Nullable
String msgFormat,
Object... msgArgs)
throws IllegalArgumentException
expression - msgFormat - msgArgs - IllegalArgumentExceptionString.format(String, Object...)Copyright © 2016. All Rights Reserved.