Package io.tarantool.driver.utils
Class Assert
- java.lang.Object
-
- io.tarantool.driver.utils.Assert
-
public final class Assert extends Object
Provides simple assertions throwingIllegalArgumentException
with the specified message.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
hasText(String object, String message)
Asserts if the given String is not emptystatic void
notEmpty(Collection<?> collection, String message)
Asserts if the given Collection is not emptystatic void
notNull(Object object, String message)
Asserts if the passed object is notnull
static void
state(boolean expression, String message)
Asserts if the passed expression istrue
-
-
-
Method Detail
-
state
public static void state(boolean expression, String message) throws IllegalArgumentException
Asserts 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
-
-