当前位置:网站首页>[party benefits] jsonobject to string, leave blank
[party benefits] jsonobject to string, leave blank
2022-07-01 03:39:00 【Three person studio】
The same problem :
Redis Leave an empty field and take it out
JSONObject To String Leave blank fields when typing
take String Type to JSONObject Leave blank fields when typing
reason
Object The type and JSONObject Type to String When type , Empty fields are automatically ignored .
Solution
Use class Entity classes are output as templates , take String Type to entity type
Need to introduce hutool
import cn.hutool.json.JSONUtil;
...
UserInfo userinfo = JSONUtil.toBean(String.valueOf(redisUtil.get(UserToken)),UserInfo.class)
UserInfo.java
import lombok.Data;
// Virtual entity class that outputs user information
@Data
public class UserInfo {
private String id;
private String username;
private String realname;
}
Then through the entity class get and set Just output .
边栏推荐
- Random seed torch in deep learning manual_ seed(number)、torch. cuda. manual_ seed(number)
- Data exchange JSON
- pytorch中的双线性插值上采样(Bilinear Upsampling)、F.upsample_bilinear
- Feature pyramid networks for object detection
- 网页不能右键 F12 查看源代码解决方案
- Feign远程调用和Getaway网关
- Avalanche problem and the use of sentinel
- 在线公网安备案保姆级教程【伸手党福利】
- Nacos
- Split(), split(), slice(), can't you tell?
猜你喜欢

IPv4 and IPv6, LAN and WAN, gateway, public IP and private IP, IP address, subnet mask, network segment, network number, host number, network address, host address, and IP segment / number - what does

Take you through a circuit board, from design to production (dry goods)

Filter

Keil5中如何做到 0 Error(s), 0 Warning(s).

bootsrap中的栅格系统

Data exchange JSON

Introduction to EtherCAT

Detailed list of errors related to twincat3 ads of Beifu

Develop industrial Internet with the technical advantages of small programs

使用selenium自动化测试工具爬取高考相关院校专业招生分数线及排名情况
随机推荐
Ouc2021 autumn - Software Engineering - end of term (recall version)
Introduction to EtherCAT
RSN:Learning to Exploit Long-term Relational Dependencies in Knowledge Graphs
Learning notes for introduction to C language multithreaded programming
shell脚本使用两个横杠接收外部参数
C语言的sem_t变量类型
Develop industrial Internet with the technical advantages of small programs
Finally in promise
Server rendering technology JSP
Pyramid Scene Parsing Network【PSPNet】论文阅读
The difference between MFC for static libraries and MFC for shared libraries
C language EXECL function
【伸手党福利】JSONObject转String保留空字段
Download and installation configuration of cygwin
打包iso文件的话,怎样使用hybrid格式输出?isohybrid:command not found
Test function in pychram
终极套娃 2.0 | 云原生交付的封装
Golang multi graph generation gif
Data exchange JSON
5、【WebGIS实战】软件操作篇——服务发布及权限管理