public class LettuceAssert extends Object
Modifier and Type | Method and Description |
---|---|
static void |
assertState(boolean condition,
String message)
Ensures the truth of an expression involving the state of the calling instance, but not involving any parameters to the
calling method.
|
static void |
isTrue(boolean value,
String message)
Assert that
value is true. |
static void |
noNullElements(Collection<?> c,
String message)
Assert that a
Collection has no null elements. |
static void |
noNullElements(Object[] array,
String message)
Assert that an array has no null elements.
|
static void |
notEmpty(int[] array,
String message)
Assert that an array has elements; that is, it must not be
null and must have at least one element. |
static void |
notEmpty(Object[] array,
String message)
Assert that an array has elements; that is, it must not be
null and must have at least one element. |
static void |
notEmpty(String string,
String message)
Assert that a string is not empty, it must not be
null and it must not be empty. |
static void |
notNull(Object object,
String message)
Assert that an object is not
null . |
public static void notEmpty(String string, String message)
null
and it must not be empty.string
- the object to checkmessage
- the exception message to use if the assertion failsIllegalArgumentException
- if the object is null
or the underlying string is emptypublic static void notNull(Object object, String message)
null
.object
- the object to checkmessage
- the exception message to use if the assertion failsIllegalArgumentException
- if the object is null
public static void notEmpty(Object[] array, String message)
null
and must have at least one element.array
- the array to checkmessage
- the exception message to use if the assertion failsIllegalArgumentException
- if the object array is null
or has no elementspublic static void notEmpty(int[] array, String message)
null
and must have at least one element.array
- the array to checkmessage
- the exception message to use if the assertion failsIllegalArgumentException
- if the object array is null
or has no elementspublic static void noNullElements(Object[] array, String message)
array
- the array to checkmessage
- the exception message to use if the assertion failsIllegalArgumentException
- if the object array contains a null
elementpublic static void noNullElements(Collection<?> c, String message)
Collection
has no null elements.c
- the collection to checkmessage
- the exception message to use if the assertion failsIllegalArgumentException
- if the Collection
contains a null
elementpublic static void isTrue(boolean value, String message)
value
is true.value
- the value to checkmessage
- the exception message to use if the assertion failsIllegalArgumentException
- if the object array contains a null
elementpublic static void assertState(boolean condition, String message)
condition
- a boolean expressionmessage
- the exception message to use if the assertion failsIllegalStateException
- if expression
is falseCopyright © 2019 lettuce.io. All rights reserved.