public abstract class Assert extends Object
Modifier and Type | Method and Description |
---|---|
static void |
isFalse(boolean expression,
Supplier<String> messageSupplier)
Asserts that the given
expression is false. |
static void |
isTrue(boolean expression,
Supplier<String> messageSupplier)
Asserts that the given
expression is true. |
static void |
notNull(Object value,
Supplier<String> messageSupplier)
Assert that the given
value is not null . |
static void |
state(boolean state,
Supplier<String> messageSupplier)
Asserts that the value of
state is true. |
public static void state(boolean state, Supplier<String> messageSupplier)
state
is true. If not, an IllegalStateException is thrown.state
- the state validation expressionmessageSupplier
- Supplier of the exception message if state evaluates to falsepublic static void isTrue(boolean expression, Supplier<String> messageSupplier)
expression
is true. If not, an IllegalArgumentException is thrown.expression
- the state validation expressionmessageSupplier
- Supplier of the exception message if the expression evaluates to falsepublic static void isFalse(boolean expression, Supplier<String> messageSupplier)
expression
is false. If not, an IllegalArgumentException is thrown.expression
- the state validation expressionmessageSupplier
- Supplier of the exception message if the expression evaluates to trueCopyright © 2010–2017. All rights reserved.