public final class Preconditions
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static void |
cannotInstantiate(java.lang.Class<?> clazz)
Throws an exception that the user cannot instantiate the given class
|
static <T> void |
notEmpty(T[] array,
java.lang.String errorMessage)
Ensures that the given array is not empty
|
static <T> T |
notNull(T t,
java.lang.String err)
Checks that the specified object reference is not
null. |
public static <T> void notEmpty(T[] array,
java.lang.String errorMessage)
T - The array typearray - Array to checkerrorMessage - Error message to throw with@Contract(value="null, _ -> fail; !null, _ -> param1")
public static <T> T notNull(T t,
java.lang.String err)
null. This will
automatically append cannot be null! to the error message.T - The object typet - Object to checkerr - Error message.@Contract(value="_ -> fail") public static void cannotInstantiate(java.lang.Class<?> clazz)
clazz - Class to prevent instantiating