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

com.zopen.aliyun.exception.AliyunAssert Maven / Gradle / Ivy

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

import com.zcj.util.UtilString;
import org.springframework.util.CollectionUtils;

import java.util.Map;

public class AliyunAssert {

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

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

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

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

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy