1.集合判空
1.1 List集合判空
//集合为NULL或集合大小为0,判断为空
import org.apache.commons.collections.CollectionUtils;
List list = new ArrayList();
CollectionUtils.isEmpty(list);
2.Map判空
//Map为NULL或没有键值对判断为空
Map的自带方法-java.util.Map.isEmpty()
Map map = new HashMap();
map.isEmpty();
3.字符串判空
//字符串为NULL或字符串长度为0,判断为空
import org.apache.commons.lang.StringUtils;
String str = "";
StringUtils.isNotBlank(str);