public abstract class Assert extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
isFalse(boolean expression,
String message)
Asserts that the given
expression is false. |
static void |
isTrue(boolean expression,
String message)
Asserts that the given
expression is true. |
static void |
notEmpty(String value,
String message)
Assert that the given
value is not null or empty. |
static void |
notNull(Object value,
String message)
Assert that the given
value is not null. |
static void |
state(boolean state,
String message)
Asserts that the value of
state is true. |
public static void state(boolean state,
String message)
state is true. If not, an IllegalStateException is thrown.state - the state validation expressionmessage - The message that the exception contains if state evaluates to falsepublic static void isTrue(boolean expression,
String message)
expression is true. If not, an IllegalArgumentException is thrown.expression - the state validation expressionmessage - The message that the exception contains if state evaluates to falsepublic static void isFalse(boolean expression,
String message)
expression is false. If not, an IllegalArgumentException is thrown.expression - the state validation expressionmessage - The message that the exception contains if state evaluates to truepublic static void notNull(Object value, String message)
value is not null. If not, an IllegalArgumentException is
thrown.value - the value not to be nullmessage - The message to add to the exception when the assertion failsCopyright © 2010-2014. All Rights Reserved.