Assert(cn.hutool.core.lang)断言可以代替if判断,使得代码逻辑更加清晰。
Assert.isTrue(表达式, () -> new BizException(ErrorCode));
Assert.isFalse(表达式, () -> new BizException(ErrorCode));
Assert.notNull(表达式, () -> new BizException(ErrorCode));
最后修改:2024 年 12 月 26 日
如果觉得我的文章对你有用,请随意赞赏