String.isNotBlank(str) //判断字符串不为空 String.isBlank(str)//判断字符串为空 //判断List,Map,Set等不为空 if(null != list && !list.isEmpty()){ //code }