Package com.luna.common.check
Class AssertUtil
java.lang.Object
com.luna.common.check.AssertUtil
校验辅助类
- Author:
- luna
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidfail(BaseException baseException, String... extendInfos) 抛出指定运行时异常static voidisFalse(boolean condition, BaseException baseException, String... extendInfos) 校验指定条件为truestatic voidisTrue(boolean condition, BaseException baseException, String... extendInfos) 校验指定条件为truestatic voidnotBlank(String str, BaseException baseException, String... extendInfos) 校验字符串不能为空static voidnotEmpty(Collection collection, BaseException baseException, String... extendInfos) 校验指定集合不能为空static voidnotEmpty(Map map, BaseException baseException, String... extendInfos) 校验指定对象不能为nullstatic voidnotNull(Object object, BaseException baseException, String... extendInfos) 校验指定对象不能为null
-
Method Details
-
notNull
校验指定对象不能为null- Parameters:
object- 对象baseException- 运行时异常
-
notEmpty
public static void notEmpty(Collection collection, BaseException baseException, String... extendInfos) 校验指定集合不能为空- Parameters:
collection- 集合baseException- 运行时异常
-
notEmpty
校验指定对象不能为null- Parameters:
map- map集合baseException- 运行时异常
-
notBlank
校验字符串不能为空- Parameters:
str- 字符串baseException- 运行时异常
-
isFalse
校验指定条件为true- Parameters:
condition- 条件baseException- 运行时异常
-
isTrue
校验指定条件为true- Parameters:
condition- 条件baseException- 运行时异常
-
fail
抛出指定运行时异常- Parameters:
baseException- 运行时异常
-