Java开发中判断集合类为空的方法-转载

时间:2021-06-24 16:38:33

避免写两个判断

org.springframework.util.CollectionUtils

方法:

public static boolean isEmpty(Collection collection)
{
return collection == null || collection.isEmpty();
}

public static boolean isEmpty(Map map)
{
return map == null || map.isEmpty();
}
---------------------
原文:https://blog.****.net/sinosoft12345/article/details/54614005

相关文章