public abstract class Assert extends Object
| 构造器和说明 |
|---|
Assert() |
public static void notNull(@Nullable Object object, String message)
null.
Assert.notNull(clazz, "The class must not be null");
object - the object to checkmessage - the exception message to use if the assertion failsIllegalArgumentException - if the object is nullpublic static void isTrue(boolean expression,
String message)
IllegalArgumentException
if the expression evaluates to false.
Assert.isTrue(i > 0, "The value must be greater than zero");
expression - a boolean expressionmessage - the exception message to use if the assertion failsIllegalArgumentException - if expression is falseCopyright © 2022. All rights reserved.