fastjson list转json

1,内容是字符串

String json = JSON. toJSONString(list);

结果:["111" ,"222"]

2,内容是时间

SerializeConfig config = new SerializeConfig();

config. put(Date.class, new SimpleDateFormatSerializer("yyyy-MM-dd HH:mm:ss"));

String json = JSON. toJSONString(list, config);

System. out. println(json);

结果:["2022-11-05 11:23:22" ," 2022-11-05 11 :23:22"]

3,内容是对象

List students = new ArrayList<>();

String json = JSON.toJSONString(students);

结果:【{111},{222}】

相关推荐
qq_3280678110 小时前
springboot4 启动 Unable to find JSON tool
spring boot·json
踏浪无痕21 小时前
你真的懂泛型吗?手写 MyBatis-Plus + Jackson,揭秘框架设计的精髓
后端·json·mybatis
Appreciate(欣赏)1 天前
Spark解析JSON字符串
大数据·spark·json
wtsolutions1 天前
JSON转Excel工具新增WPS插件功能,将JSON转换成WPS表格工作表数据
json·excel·wps·插件·转换·加载项·wtsolutions
开始了码1 天前
qt::JSON文件介绍和操作
qt·json
SongYuLong的博客1 天前
C++基于jsoncpp开源库json数据操作
开发语言·c++·json
10km1 天前
java:json-path支持fastjson作为JSON解析提供者的技术实现
java·json·fastjson·json-path
哈哈~haha2 天前
ui5_Walkthrough_Step 7:JSON Model
json·mvc·module·ui5
随风一样自由2 天前
React内逐行解释这个 package.json 文件,最近搞了个工厂AI生产平台,顺便来学习一下
学习·react.js·json·package
wtsolutions2 天前
Excel to JSON by WTSolutions 4.0.0 版本更新公告
json·excel·wps·插件·转换·加载项·wtsolutions