public class PreConditions extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
assertArgument(boolean expression) |
static void |
assertArgument(boolean expression,
String msg) |
static void |
assertArray(byte[] array) |
static void |
assertArray(byte[] array,
int offset,
int length) |
static void |
assertArray(byte[] array,
int offset,
int length,
String msg) |
static <T> Collection<T> |
assertCollectionNotEmpty(Collection<T> reference) |
static <T> Collection<T> |
assertCollectionNotEmpty(Collection<T> reference,
String msg) |
static String |
assertNotEmpty(String reference) |
static String |
assertNotEmpty(String reference,
String msg) |
static <T> T |
assertNotNull(T reference) |
static <T> T |
assertNotNull(T reference,
String msg) |
static <T> void |
assertNull(T reference) |
static <T> void |
assertNull(T reference,
String msg) |
static boolean |
checkIfEmpty(String string) |
static boolean |
checkIfNotEmpty(String string) |
static String |
ensureNotEmpty(String reference,
String msg) |
static <T> T |
ensureNotNull(T reference) |
static <T> T |
ensureNotNull(T reference,
String msg) |
static <T> T |
ifNull(T reference,
T defaultValue) |
public static <T> void assertNull(T reference,
String msg)
throws IllegalArgumentException
IllegalArgumentExceptionpublic static <T> void assertNull(T reference)
throws IllegalArgumentException
IllegalArgumentExceptionpublic static <T> T assertNotNull(T reference,
String msg)
throws IllegalArgumentException
IllegalArgumentExceptionpublic static <T> T assertNotNull(T reference)
throws IllegalArgumentException
IllegalArgumentExceptionpublic static String assertNotEmpty(String reference) throws IllegalArgumentException
IllegalArgumentExceptionpublic static String assertNotEmpty(String reference, String msg) throws IllegalArgumentException
IllegalArgumentExceptionpublic static <T> Collection<T> assertCollectionNotEmpty(Collection<T> reference) throws IllegalArgumentException
IllegalArgumentExceptionpublic static <T> Collection<T> assertCollectionNotEmpty(Collection<T> reference, String msg) throws IllegalArgumentException
IllegalArgumentExceptionpublic static void assertArgument(boolean expression,
String msg)
throws IllegalArgumentException
IllegalArgumentExceptionpublic static void assertArgument(boolean expression)
throws IllegalArgumentException
IllegalArgumentExceptionpublic static void assertArray(byte[] array,
int offset,
int length,
String msg)
throws IllegalArgumentException
IllegalArgumentExceptionpublic static void assertArray(byte[] array)
throws IllegalArgumentException
IllegalArgumentExceptionpublic static void assertArray(byte[] array,
int offset,
int length)
throws IllegalArgumentException
IllegalArgumentExceptionpublic static <T> T ensureNotNull(T reference,
String msg)
throws IllegalArgumentException
IllegalArgumentExceptionpublic static <T> T ensureNotNull(T reference)
throws IllegalArgumentException
IllegalArgumentExceptionpublic static String ensureNotEmpty(String reference, String msg) throws IllegalArgumentException
IllegalArgumentExceptionpublic static boolean checkIfEmpty(String string)
public static boolean checkIfNotEmpty(String string)
public static <T> T ifNull(T reference,
T defaultValue)
Copyright © 2021. All Rights Reserved.