吉安感知网项目-后端
xiebin
2026-01-06 d207a86cdf1ab52ef8cb7cd83bad8fceab8038cf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package org.sxkj.common.utils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.util.ObjectUtils;
 
 
/**
 * 校验提取工具类
 *
 * @author raojiangang
 */
public class ValidUtil {
    private static final Logger logger = LoggerFactory.getLogger(ValidUtil.class);
 
    public static void assertNull(Object object, String errorMsg) {
        if (ObjectUtils.isEmpty(object)) {
            throw new RuntimeException(errorMsg);
        }
    }
    public static void assertIf(Boolean isTrue, String errorMsg) {
        if (isTrue) {
            throw new RuntimeException(errorMsg);
        }
    }
 
}