源码:
使用的是ObjectUtils.isEmpty
是由org.springframework.util.ObjectUtils提供的。
String str1 = "";
String str2 = null;
ArrayList<String> arrayList = new ArrayList<>();
HashMap<String, String> map = new HashMap<>();
System.out.println(ObjectUtils.isEmpty(str1));//true
System.out.println(ObjectUtils.isEmpty(str2));//true
System.out.println(ObjectUtils.isEmpty(arrayList));//true
System.out.println(ObjectUtils.isEmpty(map));//true