CheckUtils.notNull(articleDTO.getId(), "文章上下架状态更新失败:没有有效的文章ID");
CheckUtils
public static void notNull(Object obj, String template, Object... params) {
AssertUtils.notNull(obj, ILLEGAL_PARAM, template, params);
}
AssertUtils
public static void notNull(Object obj, String errorCode, String template, Object... params) {
notNull(obj, new BaseException(errorCode, buildMsg(template, params)));
}
public static void notNull(Object obj, RuntimeException rt) {
if (obj == null) {
throwRt(rt, "the object should be not null");
}
}
private static void throwRt(RuntimeException rt, String msg) {
throw rt == null ? new IllegalStateException(msg) : rt;
}