public final class Preconditions extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
ARGUMENT_EMPTY |
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
checkNotNull(T reference)
Verifies that the given object reference is not
null. |
static <T> T |
checkNotNull(T reference,
String message)
Verifies that the given object reference is not
null. |
static String |
checkNotNullOrEmpty(String s)
Verifies that the given
String is not null or empty. |
static String |
checkNotNullOrEmpty(String s,
String message)
Verifies that the given
String is not null or empty. |
static <T> T[] |
checkNotNullOrEmpty(T[] array)
Verifies that the given array is not
null or empty. |
public static final String ARGUMENT_EMPTY
public static String checkNotNullOrEmpty(String s)
String is not null or empty.s - the given String.String.NullPointerException - if the given String is null.IllegalArgumentException - if the given String is empty.public static String checkNotNullOrEmpty(String s, String message)
String is not null or empty.s - the given String.message - error message in case of empty String.String.NullPointerException - if the given String is null.IllegalArgumentException - if the given String is empty.public static <T> T[] checkNotNullOrEmpty(T[] array)
null or empty.array - the given array.NullPointerException - if the given array is null.IllegalArgumentException - if the given array is empty.public static <T> T checkNotNull(T reference)
null.reference - the given object reference.null reference that was validated.NullPointerException - if the given object reference is null.public static <T> T checkNotNull(T reference,
String message)
null.reference - the given object reference.message - error message in case of null reference.null reference that was validated.NullPointerException - if the given object reference is null.Copyright © 2013-2014 AssertJ. All Rights Reserved.