类 Assert
- java.lang.Object
-
- cn.hutool.core.lang.Assert
-
- ai.yue.library.base.util.Assert
-
public class Assert extends cn.hutool.core.lang.AssertRESTful断言- 从以下版本开始:
- 2022/7/22
- 作者:
- ylyue
-
-
构造器概要
构造器 构造器 说明 Assert()
-
方法概要
所有方法 静态方法 具体方法 修饰符和类型 方法 说明 static voidnotThrow(String throwMsg, Runnable lambdaRun)断言-执行给定代码块不会抛出异常static voidnotThrowIfErrorPrintMsg(String printMsg, Runnable lambdaRun)断言-执行给定代码块不会抛出异常static voidnotThrowIfErrorPrintStackTrace(String printMsg, Runnable lambdaRun)断言-执行给定代码块不会抛出异常-
从类继承的方法 cn.hutool.core.lang.Assert
checkBetween, checkBetween, checkBetween, checkBetween, checkBetween, checkBetween, checkBetween, checkBetween, checkBetween, checkBetween, checkIndex, checkIndex, equals, equals, equals, isAssignable, isAssignable, isFalse, isFalse, isFalse, isInstanceOf, isInstanceOf, isNull, isNull, isNull, isTrue, isTrue, isTrue, noNullElements, noNullElements, noNullElements, notBlank, notBlank, notBlank, notContain, notContain, notContain, notEmpty, notEmpty, notEmpty, notEmpty, notEmpty, notEmpty, notEquals, notEquals, notEquals, notNull, notNull, notNull, state, state, state
-
-
-
-
方法详细资料
-
notThrow
public static void notThrow(String throwMsg, Runnable lambdaRun)
断言-执行给定代码块不会抛出异常若不是期望的结果,执行代码块时出现错误,将抛出ResultException
- 参数:
throwMsg- 执行代码块错误时抛出的ResultException messagelambdaRun- lambda给定代码块,示例:() -> {代码块}
-
notThrowIfErrorPrintMsg
public static void notThrowIfErrorPrintMsg(String printMsg, Runnable lambdaRun)
断言-执行给定代码块不会抛出异常若不是期望的结果,执行代码块时出现错误,将打印printMsg
- 参数:
printMsg- 执行代码块错误时,打印的信息lambdaRun- lambda给定代码块,示例:() -> {代码块}
-
-