当前位置:网站首页>JSON conversion: entity classes and jsonobject are converted to each other, and list and jsonarray are converted to each other (fastjson version)
JSON conversion: entity classes and jsonobject are converted to each other, and list and jsonarray are converted to each other (fastjson version)
2022-06-12 01:35:00 【shangfengxia】
1. Entity classes and JSONObject Interturn
// Entity class converted to JSONObject
JSONObject jsonObject = JSONObject.parseObject(JSON.toJSONString(xtDmbm));
//JSONObject Convert to entity class
XtDmbm xtDmbm = JSONObject.toJavaObject(jsonObject, XtDmbm.class);2.List<T> and JSONArray Interturn
//List To JSONArray
JSONArray jsonArray = JSONArray.parseArray(JSON.toJSONString(list));
//JSONArray To List
List<XtDmbm> list = JSONObject.parseArray(jsonArray.toJSONString(), XtDmbm.class);3.Map and JSONObject Interturn ( Same as 1.)
//Map To JSONObject
JSONObject jsonObject = JSONObject.parseObject(JSON.toJSONString(map));
//JSONObject To Map
Map<String, Object> map = JSONObject.toJavaObject(jsonObject, Map.class);4.List> and JSONArray Interturn ( Same as 2.)
//List<Map<>> To JSONArray
JSONArray jsonArray = JSONArray.parseArray(JSON.toJSONString(listMap));
//JSONArray To List<Map<>>
List<Map<>> listMap = JSONObject.parseArray(jsonArray.toJSONString(), Map.class);边栏推荐
- Watermelon video synchronization Tiktok also has benefits ~ the official "China Video Partner Program"
- 马尔可夫网络 与 条件随机场
- I worked as a software testing engineer in a large factory and wrote "one day's complete workflow"
- SQL exercise summary 3
- 【项目实训】jwt
- 2022年重氮化工艺考试题库模拟考试平台操作
- 华为,这也太强了吧..
- 2022年重氮化工艺考试题库模拟考试平台操作
- Interviewer: do you understand redis' shared object pool?
- State Administration of market supervision and state Internet Information Office: carry out data security management certification
猜你喜欢

Low code platform design exploration, how to better empower developers

Common assertions for JMeter interface testing

Perceptron from 0 to 1

A summary of the interface automation test problems most easily encountered

PCA from 0 to 1

A knowledge map (super dry goods, recommended collection!)

Jvm: thread context classloader

一看就懂的JMeter操作流程

Several visualization methods of point cloud 3D object detection results (second, pointpillars, pointrcnn)

Introduction to prism framework - Modular introduction
随机推荐
Kmeans from 0 to 1
Jmeter接口测试之常用断言
[n32g457] remote monitoring of graffiti cloud based on RT thread and n32g457
Matlab 基础应用02 wind 股票数据介绍和使用案例:
Defect detection, introduction to Halcon case.
【科普视频】到底什么是透镜天线?
"Xilin chain" of Southwest Forestry University passed the functional test of Electronic Standards Institute of the Ministry of industry and information technology | FISCO bcos case
感知机从0到1
[roe] (2) roe agreement
The resignation of the chief oracle engineer was furious: MySQL is a terrible database, so it is recommended to consider PostgreSQL!
You don't need to show your talent. The method is here. You earn 9844 in 31 days as an we media
【项目实训】校验注解
kmeans从0到1
Three line code solution - Maximum sub segment and - DP
Unity顶点动画的阴影实现
实体类DTO转VO通过插件转化
Some suggestions on writing code to reproduce the paper!
Shadow implementation of unity vertex animation
Equipment encryption of industrial control security
The CSV used for JMeter performance test is bullshit