public abstract class Assert extends Object
Some code was copied from org.springframework.util.Assert copyright belongs to the original author.
| 构造器和说明 |
|---|
Assert() |
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
hasText(String text)
Assert that the given String has valid text content; that is, it must not
be
null and must contain at least one non-whitespace character. |
static <T extends RuntimeException> |
hasText(String text,
Class<T> exceptionClass,
String message) |
static void |
hasText(String text,
String message)
Assert that the given String has valid text content; that is, it must not
be
null and must contain at least one non-whitespace character. |
static void |
isFalse(boolean expression) |
static <T extends RuntimeException> |
isFalse(boolean expression,
Class<T> exceptionClass,
String message) |
static void |
isFalse(boolean expression,
String message) |
static void |
isNull(Object object) |
static <T extends RuntimeException> |
isNull(Object object,
Class<T> exceptionClass,
String message) |
static void |
isNull(Object object,
String message) |
static void |
isTrue(boolean expression) |
static <T extends RuntimeException> |
isTrue(boolean expression,
Class<T> exceptionClass,
String message) |
static void |
isTrue(boolean expression,
String message) |
static void |
notNull(Object object) |
static <T extends RuntimeException> |
notNull(Object object,
Class<T> exceptionClass,
String message) |
static void |
notNull(Object object,
String message) |
public static void isTrue(boolean expression)
public static void isTrue(boolean expression,
String message)
public static <T extends RuntimeException> void isTrue(boolean expression, Class<T> exceptionClass, String message)
public static void isFalse(boolean expression)
public static void isFalse(boolean expression,
String message)
public static <T extends RuntimeException> void isFalse(boolean expression, Class<T> exceptionClass, String message)
public static void notNull(Object object)
public static <T extends RuntimeException> void notNull(Object object, Class<T> exceptionClass, String message)
public static void isNull(Object object)
public static <T extends RuntimeException> void isNull(Object object, Class<T> exceptionClass, String message)
public static void hasText(String text)
null and must contain at least one non-whitespace character.
Assert.hasText(name);
text - the String to checkIllegalArgumentException - if the text does not contain valid text contentStringUtils.hasText(java.lang.CharSequence)public static void hasText(String text, String message)
null and must contain at least one non-whitespace character.
Assert.hasText(name, "'name' must not be empty");
text - the String to checkmessage - the exception message to use if the assertion failsIllegalArgumentException - if the text does not contain valid text contentStringUtils.hasText(java.lang.CharSequence)public static <T extends RuntimeException> void hasText(String text, Class<T> exceptionClass, String message)
Copyright © 2017. All rights reserved.