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