|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.axonframework.common.Assert
public abstract class Assert
Utility class (inspired by Springs Assert class) for doing assertions on parameters and object state. To remove the need for explicit dependencies on Spring, the functionality of that class is migrated to this class.
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
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 null
message
- The message to add to the exception when the assertion failspublic static void notEmpty(String value, String message)
value
is not null
or empty. If not, an IllegalArgumentException
is thrown.
value
- the value to contain at least one charactermessage
- The message to add to the exception when the assertion fails
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |