当前位置:网站首页>[Code] if (list! = null & list. Size() > 0) optimization, set empty judgment implementation method
[Code] if (list! = null & list. Size() > 0) optimization, set empty judgment implementation method
2022-07-03 06:39:00 【The gold digger said】
It's old , Write high frequency , I want to change my taste …
this is it : if(list != null && list.size() > 0) ===》 CollectionUtils.isNotEmpty(list);
if (list != null && list.size() > 0) {
//TODO Perform logical
}
//import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
if (CollectionUtils.isNotEmpty(list)) {
//TODO Perform logical
}
/** * Collection Tool class * * @author Caratacus * @since 2016-09-19 */
public class CollectionUtils {
/** * Verify that the set is empty * * @param coll Enter the reference * @return boolean */
public static boolean isEmpty(Collection<?> coll) {
return (coll == null || coll.isEmpty());
}
/** * Verify whether the set is not empty * * @param coll Enter the reference * @return boolean */
public static boolean isNotEmpty(Collection<?> coll) {
return !isEmpty(coll);
}
......
}
By way , Elegant expression
边栏推荐
- 【LeetCode】Day93-两个数组的交集 II
- 【C#/VB.NET】 将PDF转为SVG/Image, SVG/Image转PDF
- 【类和对象】深入浅出类和对象
- YOLOV2学习与总结
- 100000 bonus is divided up. Come and meet the "sister who braves the wind and waves" among the winners
- Local rviz call and display of remote rostopic
- “我为开源打榜狂”第一周榜单公布,160位开发者上榜
- Oracle database synonym creation
- JMeter performance automation test
- Summary of the design and implementation of the weapon system similar to the paladin of vitality
猜你喜欢

SSH link remote server and local display of remote graphical interface

Push box games C #

Support vector machine for machine learning

数值法求解最优控制问题(一)——梯度法
![[open source project recommendation colugomum] this group of undergraduates open source retail industry solutions based on the domestic deep learning framework paddlepadddle](/img/f8/0e3fbfd13bf06291a73200552ff17a.png)
[open source project recommendation colugomum] this group of undergraduates open source retail industry solutions based on the domestic deep learning framework paddlepadddle
![[set theory] relational closure (relational closure solution | relational graph closure | relational matrix closure | closure operation and relational properties | closure compound operation)](/img/a4/00aca72b268f77fe4fb24ac06289f5.jpg)
[set theory] relational closure (relational closure solution | relational graph closure | relational matrix closure | closure operation and relational properties | closure compound operation)

Local rviz call and display of remote rostopic

10万奖金被瓜分,快来认识这位上榜者里的“乘风破浪的姐姐”

Paper notes vsalm literature review "a comprehensive survey of visual slam algorithms"

JMeter linked database
随机推荐
The list of "I'm crazy about open source" was released in the first week, with 160 developers on the list
opencv
剖析虚幻渲染体系(16)- 图形驱动的秘密
Opencv mouse and keyboard events
Use selenium to climb the annual box office of Yien
【无标题】
【类和对象】深入浅出类和对象
In depth analysis of kubernetes controller runtime
UNI-APP中条件注释 实现跨段兼容、导航跳转 和 传参、组件创建使用和生命周期函数
YOLOV3学习笔记
Install VM tools
Floating menu operation
Paper notes vsalm literature review "a comprehensive survey of visual slam algorithms"
堆排序和优先队列
Use abp Zero builds a third-party login module (I): Principles
Mysql database
数值法求解最优控制问题(一)——梯度法
Unit test framework + Test Suite
Create your own deep learning environment with CONDA
冒泡排序的简单理解