五 各种判断

判断 集合是否为空:

if (list !=null && list.size() > 0) {
}			

集合去重:

判断字符串是否为空:

if(s==null || "".equals(s)){
    return "s is null"; 
}

if (StringUtils.isNotBlank(s)) {
  return "s is null"; 
}

if (StringUtils.isNotEmpty(s)) {
 return "s is null"; 
 }

判断二个字符串是否相等

List<PctBill> listAssignee = listAssigneeAll.stream().filter(ele -> !ele.getAssignee().equals(cond.getCreator()))
      .collect(Collectors.toList());

判断Integer是否为空:

if(int != null){
}

if(int == 0){
}

猜你喜欢

转载自blog.csdn.net/weixin_38441551/article/details/88022180