public abstract class Assert
extends java.lang.Object
| 构造器和说明 |
|---|
Assert() |
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
hasText(java.lang.String text,
java.lang.String message)
Assert that a string is not empty; that is, it must not be
null and not the
empty string. |
static void |
isTrue(boolean expression,
java.lang.String message)
Assert a boolean expression, throwing an
IllegalArgumentException if the
expression evaluates to false. |
static void |
notNull(java.lang.Object object,
java.lang.String message)
Assert that an object is not
null. |
public static void notNull(java.lang.Object object,
java.lang.String message)
null.object - the object to checkmessage - the exception message to use if the assertion failsjava.lang.IllegalArgumentException - if the object is nullpublic static void hasText(java.lang.String text,
java.lang.String message)
null and not the
empty string.text - the string to checkmessage - the exception message to use if the assertion failsjava.lang.IllegalArgumentException - if the text is emptypublic static void isTrue(boolean expression,
java.lang.String message)
IllegalArgumentException if the
expression evaluates to false.expression - a boolean expressionmessage - the exception message to use if the assertion failsjava.lang.IllegalArgumentException - if expression is false