当前位置:网站首页>How to get the map value is not so low. There are three ways to get the map parameters
How to get the map value is not so low. There are three ways to get the map parameters
2022-04-21 17:46:00 【The sky in July and August】
obtain map Three ways of parameter
1. Third party tools
common-collections-3.2.2
String name = MapUtils.getString(params, "name");
public static String getString(final Map map, final Object key) {
if (map != null) {
Object answer = map.get(key);
if (answer != null) {
return answer.toString();
}
}
return null;
}
2. Don't want to quote third parties Jar, Just imitate and write a MapUtil Tool class
3. Manual access ( It's so low 了 , Ah )
String name = null;
if (params.containsKey("name")) {
name = params.get("name").toString();
}
版权声明
本文为[The sky in July and August]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204211740318435.html
边栏推荐
- Redis三种模式——主从复制,哨兵模式,集群
- 科技云报道:DPU市场火热,未来会任由几家大厂吃独食吗?
- Brief introduction of common methods of wireless DoS attack
- 2022年新手做跨境电商五大技巧小分享
- The difference between MSIL static class and non static class in IL definition
- AI+临床试验|拜耳探索创建“虚拟”对照组
- 使用K3S创建本地开发集群
- What is ODBC – open database connectivity
- 漏洞检测与防御:Redis未授权访问漏洞复现
- Mysql database common sense storage engine
猜你喜欢

头条自媒体运营秘籍,坚持下去你就可以打败90%的人

Considering loose coupling of microservice architecture? Be careful of these traps

Vulnerability detection and defense: redis unauthorized access vulnerability recurrence

MySQL数据库常识之储存引擎

Huawei URPF

Spark SQL底层执行流程详解

老电脑应该怎么重装系统比较好
![[stack] 155 Minimum stack](/img/48/66e69d25e55dd3f568dd87af74fe05.png)
[stack] 155 Minimum stack

High expansion and high availability engineering practice of recommended resource bits related to short video app
本田北美产品规划发布!Insight混动停产,CR-V、雅阁即将发布
随机推荐
Vulnerability detection and defense: redis unauthorized access vulnerability recurrence
JVM 从入门到放弃之 ZGC 垃圾收集器
Fonctions communes pour MySQL Advanced
理想ONE终于换代?全新产品序列定名L8,重度伪装路试照曝光
正在考虑微服务架构的松耦合?小心这些陷阱
启牛理财课有用嘛?安全靠谱嘛?
直播带货源码,渐变式状态栏的不同写法
使用K3S创建本地开发集群
为什么基础设施工程师更喜欢MySQL?
新技术的应用开启了有关产业互联网的第二条路径
The application of new technologies has opened the second path of industrial Internet
Shell编程学习(三)条件判断、流程控制
为什么可以用概率分布密度函数来表示概率?
[interview ordinary people vs Expert Series] can you talk about CAS mechanism?
直播app源码,在无法显示图片的基础上添加图片显示功能
智能遍历测试在回归测试与健壮性测试的应用
林肯Z对比奥迪A4L:产品力差距,其实是两个时代的缩影
头条自媒体运营秘籍,坚持下去你就可以打败90%的人
WPF references methods that uwp controls are not packaged for msix distribution
洞见科技首批通过央行国家金融科技测评中心「联邦学习」产品评测,实现「MPC+FL」金融应用双认证