public class Preconditions
extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
checkArgument(boolean isValid)
Precondition-style validation that throws
IllegalArgumentException. |
static void |
checkArgument(boolean isValid,
String message)
Precondition-style validation that throws
IllegalArgumentException. |
static void |
checkArgument(boolean isValid,
String message,
Object... args)
Precondition-style validation that throws
IllegalArgumentException. |
public static void checkArgument(boolean isValid)
throws IllegalArgumentException
IllegalArgumentException.isValid - true if valid, false if an exception should be thrownIllegalArgumentException - if isValid is falsepublic static void checkArgument(boolean isValid,
String message)
throws IllegalArgumentException
IllegalArgumentException.isValid - true if valid, false if an exception should be thrownmessage - A String message for the exception.IllegalArgumentException - if isValid is falsepublic static void checkArgument(boolean isValid,
String message,
Object... args)
throws IllegalArgumentException
IllegalArgumentException.isValid - true if valid, false if an exception should be thrownmessage - A String message for the exception.args - Objects used to fill in %s placeholders in the messageIllegalArgumentException - if isValid is false