public class Preconditions extends Object
Utility class to validate Preconditions
| Constructor and Description |
|---|
Preconditions() |
| Modifier and Type | Method and Description |
|---|---|
static void |
checkArgument(boolean condition,
String message) |
static <T> T |
checkNotNull(T reference,
String errorMessage)
Ensures that an object reference passed as a parameter to the calling method is not null.
|
static void |
checkState(boolean condition,
String message) |
public static void checkArgument(boolean condition,
String message)
condition - Condition that the argument must satisfymessage - The Message of the exception in case the condition is invalidpublic static void checkState(boolean condition,
String message)
condition - Condition that must be satisfiedmessage - The Message of the exception in case the condition is invalidpublic static <T> T checkNotNull(T reference,
String errorMessage)
reference - an object referenceerrorMessage - the exception message to use if the check failsNullPointerException - if reference is nullCopyright © 2017 MuleSoft, Inc.. All rights reserved.