当前位置:网站首页>Eliminate the writing of 'if () else{}'
Eliminate the writing of 'if () else{}'
2022-07-05 17:57:00 【Edric_ Howe】
- If
personThe name of is empty , Then perform business assignment ID
Person person = new Person();
Optional.ofNullable(person..getName()).ifPresent(p->p.setId(1))
- If
personIf the name of is not empty, the name , Otherwise return to2
String test = Optional.ofNullable(person.getName()).orElse("2");
边栏推荐
猜你喜欢

VBA drives SAP GUI to realize office automation (II): judge whether elements exist

Leetcode daily question: merge two ordered arrays

十个顶级自动化和编排工具

ISPRS2020/云检测:Transferring deep learning models for cloud detection between Landsat-8 and Proba-V

「运维有小邓」用于云应用程序的单点登录解决方案

Sophon CE社区版上线,免费Get轻量易用、高效智能的数据分析工具

提高應用程序性能的7個DevOps實踐

"Xiaodeng in operation and maintenance" is a single sign on solution for cloud applications

MATLAB查阅

How awesome is the architecture of "12306"?
随机推荐
To solve the problem of "double click PDF file, pop up", please install Evernote program
Operation before or after Teamcenter message registration
Unicode processing in response of flash interface
EasyCVR平台通过接口编辑通道出现报错“ID不能为空”,是什么原因?
What are the requirements for PMP certification? How much is it?
Please tell me why some tables can find data by writing SQL, but they can't be found in the data map, and the table structure can't be found
[performance test] full link voltage test
集群部署如何解决海量视频接入与大并发需求?
GIMP 2.10教程「建议收藏」
Read libco save and restore the on-site assembly code
基于YOLOv3的口罩佩戴检测
网络威胁分析师应该具备的十种能力
ISPRS2022/雲檢測:Cloud detection with boundary nets基於邊界網的雲檢測
请问下为啥有的表写sql能查到数据,但在数据地图里查不到啊,查表结构也搜不到
QT console printout
[TestLink] testlink1.9.18 solutions to common problems
ITK Example
小白入门NAS—快速搭建私有云教程系列(一)[通俗易懂]
Simple query cost estimation
如何保存训练好的神经网络模型(pytorch版本)