public final class Preconditions extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
checkArgument(boolean b)
Check the specified boolean argument.
|
static void |
checkArgument(boolean b,
String message)
Check the specified boolean argument.
|
static void |
checkArgument(boolean b,
String msg,
double arg1)
|
static void |
checkArgument(boolean b,
String msg,
double arg1,
double arg2)
|
static void |
checkArgument(boolean b,
String msg,
double arg1,
double arg2,
double arg3)
|
static void |
checkArgument(boolean b,
String msg,
double arg1,
double arg2,
double arg3,
double arg4)
|
static void |
checkArgument(boolean b,
String msg,
int arg1)
|
static void |
checkArgument(boolean b,
String msg,
int arg1,
int arg2)
|
static void |
checkArgument(boolean b,
String msg,
int arg1,
int arg2,
int arg3)
|
static void |
checkArgument(boolean b,
String msg,
int arg1,
int arg2,
int arg3,
int arg4)
|
static void |
checkArgument(boolean b,
String msg,
long arg1)
|
static void |
checkArgument(boolean b,
String msg,
long arg1,
long arg2)
|
static void |
checkArgument(boolean b,
String msg,
long arg1,
long arg2,
long arg3)
|
static void |
checkArgument(boolean b,
String msg,
long arg1,
long arg2,
long arg3,
long arg4)
|
static void |
checkArgument(boolean b,
String message,
Object... args)
Check the specified boolean argument.
|
static void |
checkArgument(boolean b,
String msg,
Object arg1)
|
static void |
checkArgument(boolean b,
String msg,
Object arg1,
Object arg2)
|
static void |
checkArgument(boolean b,
String msg,
Object arg1,
Object arg2,
Object arg3)
|
static void |
checkArgument(boolean b,
String msg,
Object arg1,
Object arg2,
Object arg3,
Object arg4)
|
static void |
checkArgument(boolean b,
String msg,
Object arg1,
Object arg2,
Object arg3,
Object arg4,
Object arg5)
|
static void |
checkArgument(boolean b,
String msg,
Object arg1,
Object arg2,
Object arg3,
Object arg4,
Object arg5,
Object arg6)
|
static void |
checkNotNull(Object o)
Check the specified boolean argument.
|
static void |
checkNotNull(Object o,
String message)
Check the specified boolean argument.
|
static void |
checkNotNull(Object o,
String msg,
double arg1)
|
static void |
checkNotNull(Object o,
String msg,
double arg1,
double arg2)
|
static void |
checkNotNull(Object o,
String msg,
double arg1,
double arg2,
double arg3)
|
static void |
checkNotNull(Object o,
String msg,
double arg1,
double arg2,
double arg3,
double arg4)
|
static void |
checkNotNull(Object o,
String msg,
int arg1)
|
static void |
checkNotNull(Object o,
String msg,
int arg1,
int arg2)
|
static void |
checkNotNull(Object o,
String msg,
int arg1,
int arg2,
int arg3)
|
static void |
checkNotNull(Object o,
String msg,
int arg1,
int arg2,
int arg3,
int arg4)
|
static void |
checkNotNull(Object o,
String msg,
long arg1)
|
static void |
checkNotNull(Object o,
String msg,
long arg1,
long arg2)
|
static void |
checkNotNull(Object o,
String msg,
long arg1,
long arg2,
long arg3)
|
static void |
checkNotNull(Object o,
String msg,
long arg1,
long arg2,
long arg3,
long arg4)
|
static void |
checkNotNull(Object o,
String message,
Object... args)
Check the specified boolean argument.
|
static void |
checkNotNull(Object o,
String msg,
Object arg1)
|
static void |
checkNotNull(Object o,
String msg,
Object arg1,
Object arg2)
|
static void |
checkNotNull(Object o,
String msg,
Object arg1,
Object arg2,
Object arg3)
|
static void |
checkNotNull(Object o,
String msg,
Object arg1,
Object arg2,
Object arg3,
Object arg4)
|
static void |
checkState(boolean b)
Check the specified boolean argument.
|
static void |
checkState(boolean b,
String message)
Check the specified boolean argument.
|
static void |
checkState(boolean b,
String msg,
double arg1)
|
static void |
checkState(boolean b,
String msg,
double arg1,
double arg2)
|
static void |
checkState(boolean b,
String msg,
double arg1,
double arg2,
double arg3)
|
static void |
checkState(boolean b,
String msg,
double arg1,
double arg2,
double arg3,
double arg4)
|
static void |
checkState(boolean b,
String msg,
int arg1)
|
static void |
checkState(boolean b,
String msg,
int arg1,
int arg2)
|
static void |
checkState(boolean b,
String msg,
int arg1,
int arg2,
int arg3)
|
static void |
checkState(boolean b,
String msg,
int arg1,
int arg2,
int arg3,
int arg4)
|
static void |
checkState(boolean b,
String msg,
long arg1)
|
static void |
checkState(boolean b,
String msg,
long arg1,
long arg2)
|
static void |
checkState(boolean b,
String msg,
long arg1,
long arg2,
long arg3)
|
static void |
checkState(boolean b,
String msg,
long arg1,
long arg2,
long arg3,
long arg4)
|
static void |
checkState(boolean b,
String message,
Object... args)
Check the specified boolean argument.
|
static void |
checkState(boolean b,
String msg,
Object arg1)
|
static void |
checkState(boolean b,
String msg,
Object arg1,
Object arg2)
|
static void |
checkState(boolean b,
String msg,
Object arg1,
Object arg2,
Object arg3)
|
static void |
checkState(boolean b,
String msg,
Object arg1,
Object arg2,
Object arg3,
Object arg4)
|
static void |
checkState(boolean b,
String msg,
Object arg1,
Object arg2,
Object arg3,
Object arg4,
Object arg5)
|
static void |
checkState(boolean b,
String msg,
Object arg1,
Object arg2,
Object arg3,
Object arg4,
Object arg5,
Object arg6)
|
static String |
formatArray(Object o) |
static void |
throwEx(String message,
Object... args) |
static void |
throwNullPointerEx(String message,
Object... args) |
static void |
throwStateEx(String message,
Object... args) |
public static void checkArgument(boolean b)
b is falseb - Argument to checkpublic static void checkArgument(boolean b,
String message)
b is falseb - Argument to checkmessage - Message for exception. May be nullpublic static void checkArgument(boolean b,
String msg,
int arg1)
public static void checkArgument(boolean b,
String msg,
long arg1)
public static void checkArgument(boolean b,
String msg,
double arg1)
public static void checkArgument(boolean b,
String msg,
int arg1,
int arg2)
public static void checkArgument(boolean b,
String msg,
long arg1,
long arg2)
public static void checkArgument(boolean b,
String msg,
double arg1,
double arg2)
public static void checkArgument(boolean b,
String msg,
int arg1,
int arg2,
int arg3)
public static void checkArgument(boolean b,
String msg,
long arg1,
long arg2,
long arg3)
public static void checkArgument(boolean b,
String msg,
double arg1,
double arg2,
double arg3)
public static void checkArgument(boolean b,
String msg,
Object arg1,
Object arg2,
Object arg3)
public static void checkArgument(boolean b,
String msg,
int arg1,
int arg2,
int arg3,
int arg4)
public static void checkArgument(boolean b,
String msg,
long arg1,
long arg2,
long arg3,
long arg4)
public static void checkArgument(boolean b,
String msg,
double arg1,
double arg2,
double arg3,
double arg4)
public static void checkArgument(boolean b,
String msg,
Object arg1,
Object arg2,
Object arg3,
Object arg4)
public static void checkArgument(boolean b,
String msg,
Object arg1,
Object arg2,
Object arg3,
Object arg4,
Object arg5)
public static void checkArgument(boolean b,
String msg,
Object arg1,
Object arg2,
Object arg3,
Object arg4,
Object arg5,
Object arg6)
public static void checkArgument(boolean b,
String message,
Object... args)
b is false.
Note that the message may specify argument locations using "%s" - for example,
checkArgument(false, "Got %s values, expected %s", 3, "more" would throw an IllegalArgumentException
with the message "Got 3 values, expected more"b - Argument to checkmessage - Message for exception. May be null.args - Arguments to place in messagepublic static void checkState(boolean b)
b is falseb - State to checkpublic static void checkState(boolean b,
String message)
b is falseb - State to checkmessage - Message for exception. May be nullpublic static void checkState(boolean b,
String msg,
int arg1)
public static void checkState(boolean b,
String msg,
long arg1)
public static void checkState(boolean b,
String msg,
double arg1)
public static void checkState(boolean b,
String msg,
int arg1,
int arg2)
public static void checkState(boolean b,
String msg,
long arg1,
long arg2)
public static void checkState(boolean b,
String msg,
double arg1,
double arg2)
public static void checkState(boolean b,
String msg,
int arg1,
int arg2,
int arg3)
public static void checkState(boolean b,
String msg,
long arg1,
long arg2,
long arg3)
public static void checkState(boolean b,
String msg,
double arg1,
double arg2,
double arg3)
public static void checkState(boolean b,
String msg,
Object arg1,
Object arg2,
Object arg3)
public static void checkState(boolean b,
String msg,
int arg1,
int arg2,
int arg3,
int arg4)
public static void checkState(boolean b,
String msg,
long arg1,
long arg2,
long arg3,
long arg4)
public static void checkState(boolean b,
String msg,
double arg1,
double arg2,
double arg3,
double arg4)
public static void checkState(boolean b,
String msg,
Object arg1,
Object arg2,
Object arg3,
Object arg4)
public static void checkState(boolean b,
String msg,
Object arg1,
Object arg2,
Object arg3,
Object arg4,
Object arg5)
public static void checkState(boolean b,
String msg,
Object arg1,
Object arg2,
Object arg3,
Object arg4,
Object arg5,
Object arg6)
public static void checkState(boolean b,
String message,
Object... args)
b is false.
Note that the message may specify argument locations using "%s" - for example,
checkArgument(false, "Got %s values, expected %s", 3, "more" would throw an IllegalStateException
with the message "Got 3 values, expected more"b - Argument to checkmessage - Message for exception. May be null.args - Arguments to place in messagepublic static void checkNotNull(Object o)
o is falseo - Object to checkpublic static void checkNotNull(Object o, String message)
o is falseo - Object to checkmessage - Message for exception. May be nullpublic static void checkNotNull(Object o, String msg, double arg1, double arg2, double arg3)
public static void checkNotNull(Object o, String msg, Object arg1, Object arg2, Object arg3)
public static void checkNotNull(Object o, String msg, int arg1, int arg2, int arg3, int arg4)
public static void checkNotNull(Object o, String msg, long arg1, long arg2, long arg3, long arg4)
public static void checkNotNull(Object o, String msg, double arg1, double arg2, double arg3, double arg4)
public static void checkNotNull(Object o, String msg, Object arg1, Object arg2, Object arg3, Object arg4)
public static void checkNotNull(Object o, String message, Object... args)
o is false.
Note that the message may specify argument locations using "%s" - for example,
checkArgument(false, "Got %s values, expected %s", 3, "more" would throw an IllegalStateException
with the message "Got 3 values, expected more"o - Object to checkmessage - Message for exception. May be null.args - Arguments to place in messageCopyright © 2021. All rights reserved.