当前位置:网站首页>Eliminate the writing of 'if () else{}'
Eliminate the writing of 'if () else{}'
2022-07-05 17:57:00 【Edric_ Howe】
- If
person
The name of is empty , Then perform business assignment ID
Person person = new Person();
Optional.ofNullable(person..getName()).ifPresent(p->p.setId(1))
- If
person
If the name of is not empty, the name , Otherwise return to2
String test = Optional.ofNullable(person.getName()).orElse("2");
边栏推荐
- Vulnerability recurrence - 48. Command injection in airflow DAG (cve-2020-11978)
- Tencent music launched its new product "quyimai", which provides music commercial copyright authorization
- Easynmon Usage Summary
- RSE2020/云检测:基于弱监督深度学习的高分辨率遥感图像精确云检测
- QT控制台打印输出
- GIMP 2.10教程「建议收藏」
- Troubleshooting - about clip not found Visual Studio
- 数据访问 - EntityFramework集成
- Elk log analysis system
- Neural network self cognition model
猜你喜欢
LeetCode 练习——206. 反转链表
提高應用程序性能的7個DevOps實踐
C # mixed graphics and text, written to the database in binary mode
云主机oracle异常恢复----惜分飞
Abnormal recovery of virtual machine Oracle -- Xi Fenfei
ISPRS2022/云检测:Cloud detection with boundary nets基于边界网的云检测
Count the running time of PHP program and set the maximum running time of PHP
Short the command line via jar manifest or via a classpath file and rerun
Zabbix
統計php程序運行時間及設置PHP最長運行時間
随机推荐
GIMP 2.10教程「建议收藏」
Simple query cost estimation
如何保存训练好的神经网络模型(pytorch版本)
一文读懂简单查询代价估算
热通孔的有效放置如何改善PCB设计中的热管理?
Zabbix
Compter le temps d'exécution du programme PHP et définir le temps d'exécution maximum de PHP
統計php程序運行時間及設置PHP最長運行時間
Count the running time of PHP program and set the maximum running time of PHP
Vulnerability recurrence - 48. Command injection in airflow DAG (cve-2020-11978)
Read libco save and restore the on-site assembly code
flask接口响应中的中文乱码(unicode)处理
Cmake tutorial Step3 (requirements for adding libraries)
JVM第三话 -- JVM性能调优实战和高频面试题记录
神经网络自我认知模型
Webapp development - Google official tutorial
Zabbix
登录连接 CDB 和 PDB
Cartoon: interesting pirate problem (full version)
访问数据库使用redis作为mysql的缓存(redis和mysql结合)