CollectionUtil:判断集合不为空
作者:互联网
public static boolean isNotEmpty(Object object) {
if(object instanceof List){
List<?> list = (List)object;
if(list != null && list.size() > 0){
return true;
} else {
return false;
}
} else if(object instanceof Map){
Map map = (Map)object;
if(map != null && map.size() > 0){
return true;
} else {
return false;
}
} else if(object instanceof Set){
Set<?> set = (Set) object;
if(set != null && set.size() > 0){
return true;
} else {
return false;
}
}else{
return false;
}
}
标签:set,return,object,else,集合,false,null,CollectionUtil,不为 来源: https://www.cnblogs.com/dhc1995/p/15164856.html