package com.cinc.ecmp.utils;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.apache.commons.lang.ArrayUtils;
import org.apache.commons.lang.StringUtils;
import org.springframework.util.CollectionUtils;
/**
* @Author:
* @Despriction: 判空类
* @CreatedTime: 2019/6/5 11:06
* @ModifyBy:
* @ModifyTime:
* @ModifyDespriction:
* @Version: V1.0.0
*/
public class EmptyUtils {
/**
* @param str : { str 为 null ,""," "的情况下都返回true}
* @return boolean
*/
public static boolean isStringEmpty(String str){
return StringUtils.isBlank(str);
}
/**
* @param list { list 为 null size=0 的情况下返回true}
* @return boolean
*/
public static boolean isListEmpty(List<?> list){
return CollectionUtils.isEmpty(list);
}
/**
* @param set 为 null size=0 的情况下返回true
* @return
*/
public static boolean isSetEmpty(Set<?> set){
return CollectionUtils.isEmpty(set);
}
/**
* @param map{ map.entrySet() 为空的情况下返回true }
* @return boolean
*/
public static boolean isMapEmpty(Map<?,?> map){
return CollectionUtils.isEmpty(map);
}
/**
* @param_array为空或长度为0的情况下返回true
* @return boolean
*/
public static boolean isArrayEmpty(Object [] array){
return ArrayUtils.isEmpty(array);
}
/**
* @param_array为空或长度为0的情况下返回true
* @return boolean
*/
public static boolean isArrayEmpty(int [] array){
return ArrayUtils.isEmpty(array);
}
}