Package io.tarantool.driver.utils
Class Assert
- java.lang.Object
-
- io.tarantool.driver.utils.Assert
-
public final class Assert extends Object
Provides simple assertions throwingIllegalArgumentExceptionwith the specified message.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidhasText(String object, String message)Asserts if the given String is not emptystatic voidnotEmpty(Collection<?> collection, String message)Asserts if the given Collection is not emptystatic voidnotNull(Object object, String message)Asserts if the passed object is notnullstatic voidstate(boolean expression, String message)Asserts if the passed expression istrue
-
-
-
Method Detail
-
state
public static void state(boolean expression, String message) throws IllegalArgumentExceptionAsserts if the passed expression istrue- Parameters:
expression- returns booleanmessage- exception message- Throws:
IllegalArgumentException- if the assertion fails
-
notNull
public static void notNull(Object object, String message)
Asserts if the passed object is notnull- Parameters:
object- nullable objectmessage- exception message- Throws:
IllegalArgumentException- if the assertion fails
-
hasText
public static void hasText(String object, String message)
Asserts if the given String is not empty- Parameters:
object- nullable Stringmessage- exception message- Throws:
IllegalArgumentException- if the assertion fails
-
notEmpty
public static void notEmpty(Collection<?> collection, String message)
Asserts if the given Collection is not empty- Parameters:
collection- nullable Collectionmessage- exception message- Throws:
IllegalArgumentException- if the assertion fails
-
-