Each method in this class throws a PreconditionViolationException
if the precondition is violated.
These utilities are intended solely for usage within the JUnit framework itself. Any usage by external parties is not supported. Use at your own risk!
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static void | |
| public static void | |
| public static <T> @Nullable T[] | Returns: the supplied array as a conveniencethe array to check array, String precondition violation message message)Assert that the supplied array contains no |
| public static <T> @Nullable T[] | Returns: the supplied array as a conveniencethe array to check array, Supplier<String> precondition violation message supplier messageSupplier)Assert that the supplied array contains no |
| public static <T extends Collection | Returns: the supplied collection as a conveniencethe collection to check collection, String precondition violation message message)Assert that the supplied collection contains no |
| public static <T extends Collection | Returns: the supplied collection as a conveniencethe collection to check collection, Supplier<String> precondition violation message supplier messageSupplier)Assert that the supplied collection contains no |
| public static String | |
| public static String | |
| public static int[] | |
| public static <T> T[] | |
| public static <T> T[] | |
| public static <T extends Collection | Returns: the supplied collection as a conveniencethe collection to check collection, String precondition violation message message)Assert that the supplied |
| public static <T extends Collection | Returns: the supplied collection as a conveniencethe collection to check collection, Supplier<String> precondition violation message supplier messageSupplier)Assert that the supplied |
| public static <T> T | |
| public static <T> T |
| Preconditions | back to summary |
|---|---|
| private Preconditions() | |
| condition | back to summary |
|---|---|
| public static void condition(boolean predicate, String message) throws PreconditionViolationException Assert that the supplied
| |
| condition | back to summary |
|---|---|
| public static void condition(boolean predicate, Supplier<String> messageSupplier) throws PreconditionViolationException Assert that the supplied
| |
| containsNoNullElements | back to summary |
|---|---|
| public static <T> @Nullable T[] containsNoNullElements(@Nullable T[] array, String message) throws PreconditionViolationException Assert that the supplied array contains no Warning this method does NOT check if the supplied
array is
| |
| containsNoNullElements | back to summary |
|---|---|
| public static <T> @Nullable T[] containsNoNullElements(@Nullable T[] array, Supplier<String> messageSupplier) throws PreconditionViolationException Assert that the supplied array contains no Warning this method does NOT check if the supplied
array is
| |
| containsNoNullElements | back to summary |
|---|---|
| public static <T extends Collection Assert that the supplied collection contains no Warning this method does NOT check if the supplied
collection is
| |
| containsNoNullElements | back to summary |
|---|---|
| public static <T extends Collection Assert that the supplied collection contains no Warning this method does NOT check if the supplied
collection is
| |
| notBlank | back to summary |
|---|---|
| public static String notBlank(@Nullable String str, String message) throws PreconditionViolationException Assert that the supplied A
| |
| notBlank | back to summary |
|---|---|
| public static String notBlank(@Nullable String str, Supplier<String> messageSupplier) throws PreconditionViolationException Assert that the supplied A
| |
| notEmpty | back to summary |
|---|---|
| public static int[] notEmpty(@Nullable int[] array, String message) throws PreconditionViolationException Assert that the supplied array is neither
| |
| notEmpty | back to summary |
|---|---|
| public static <T> T[] notEmpty(@Nullable T[] array, String message) throws PreconditionViolationException Assert that the supplied array is neither Warning this method does NOT check if the supplied
array contains any
| |
| notEmpty | back to summary |
|---|---|
| public static <T> T[] notEmpty(@Nullable T[] array, Supplier<String> messageSupplier) throws PreconditionViolationException Assert that the supplied array is neither Warning this method does NOT check if the supplied
array contains any
| |
| notEmpty | back to summary |
|---|---|
| public static <T extends Collection Assert that the supplied Warning this method does NOT check if the supplied
collection contains any
| |
| notEmpty | back to summary |
|---|---|
| public static <T extends Collection Assert that the supplied Warning this method does NOT check if the supplied
collection contains any
| |
| notNull | back to summary |
|---|---|
| public static <T> T notNull(@Nullable T object, String message) throws PreconditionViolationException Assert that the supplied
| |
| notNull | back to summary |
|---|---|
| public static <T> T notNull(@Nullable T object, Supplier<String> messageSupplier) throws PreconditionViolationException Assert that the supplied
| |