public class Preconditions extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
checkArgument(boolean condition,
Object argument) |
static void |
checkArgument(boolean condition,
String message) |
static void |
checkArgumentNotNull(Object reference)
Throws
IllegalArgumentException if the reference is null. |
static void |
checkArgumentNotNull(Object reference,
String argumentName)
Throws
IllegalArgumentException with an appropriate message if the reference is null. |
static void |
checkNotNull(Object reference) |
public static void checkArgumentNotNull(Object reference, String argumentName)
IllegalArgumentException with an appropriate message if the reference is null.reference - the reference to be checkedargumentName - name of the argument that is being checked. The name used in the error message.public static void checkArgumentNotNull(Object reference)
IllegalArgumentException if the reference is null. This method should only be used for methods with single argument.reference - the reference to be checkedpublic static void checkNotNull(Object reference)
reference - The reference to be checkedNullPointerException - if the reference is nullpublic static void checkArgument(boolean condition,
Object argument)
public static void checkArgument(boolean condition,
String message)
Copyright © 2017. All rights reserved.