package com.wqh.fsrm.common.util;
import java.util.*;
public class EmptyUtils {
/**
* 判断collection是否为空
* @param collection
* @return
*/
public static Boolean IsEmptyCollection(Collection collection){
if(null == collection || collection.isEmpty()){
return true;
}else{
return false;
}
}
/**
* 判断map 是否为空
* @param map
* @return
*/
public static Boolean IsEmptyMap(Map map){
if(null == map || map.isEmpty()){
return true;
}else{
return false;
}
}
/**
* 判断 list 是否为空
* @param list
*/
public static Boolean IsEmptyList(List list){
if(null == list || list.isEmpty()){
return true;
}else{
return false;
}
}
/**
* 判断set是否为空
* @param set
*/
public static Boolean IsEmptySet(Set set){
if(null == set || set.isEmpty()){
return true;
}else{
return false;
}
}
/**
* 判断字符串是否为空
* @param str
* @return
*/
public static Boolean isEmptyString(String str){
if(null == str || "".equals(str)){
return true;
}else{
return false;
}
}
public static void main(String[] args) {
Map<String,Object> map = new HashMap<>();
Boolean a = IsEmptyMap(map);
System.out.println(a);
}
}