All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.zopen.wechat.exception.WechatAssert Maven / Gradle / Ivy

There is a newer version: 1.0.5
Show newest version
package com.zopen.wechat.exception;

import com.zcj.util.UtilString;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.util.CollectionUtils;

import java.util.Map;

public class WechatAssert {

    public static void notNull(Object object, String message) {
        if (object == null) {
            throw new WechatException(message);
        }
    }

    public static void notNullAndEmpty(String object, String message) {
        if (UtilString.isBlank(object)) {
            throw new WechatException(message);
        }
    }

    public static void checkArgument(boolean expression, String message) {
        if (!expression) {
            throw new WechatException(message);
        }
    }

    public static void notEmpty(Map map, String message) {
        if (CollectionUtils.isEmpty(map)) {
            throw new WechatException(message);
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy