com.zopen.wechat.exception.WechatAssert Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of zopen-ato-starter Show documentation
Show all versions of zopen-ato-starter Show documentation
Alibaba Tencent And Others For Spring Boot.
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);
}
}
}