当前位置:网站首页>Object转Json差异之Gson fastJson jackson 修改字段名
Object转Json差异之Gson fastJson jackson 修改字段名
2022-04-23 05:45:00 【dawnsun001】
实体Bean:package .....; import java.io.Serializable; public class BeanVO implements Serializable { private String id; private String GPSDetail; public BeanVO() { } ..........get&set......................... }
执行测试方法:
public static void main(String[] args) {
BeanVO ff = new BeanVO();
ff.setGPSDetail("1");
System.out.println("--fastjson-"+JSONObject.toJSONString(ff));
System.out.println("--jackson-"+JsonSupport.object2Json(ff));
System.out.println("--gson-"+new Gson().toJson(ff));
}
结果:
--fastjson-{"gPSDetail":"1"}
--jackson-{"gpsDetail":"1"}
--gson-{"GPSDetail":"1"}
版权声明
本文为[dawnsun001]所创,转载请带上原文链接,感谢
https://blog.csdn.net/dawnsun2013/article/details/74638204
边栏推荐
- Rust 中的 Cell 共享可变指针
- 解决ArcGIS分区统计显示太多唯一值执行失败
- Basic knowledge of network in cloud computing
- Conversion between JS object and string
- LockSupport. Park and unpark, wait and notify
- Guaba and Computational Geometry
- St table template
- 爬取手游网站游戏详情和评论(MQ+多线程)
- [untitled] database - limit the number of returned rows
- [leetcode 228] summary interval
猜你喜欢
随机推荐
IO multiplexing of 09 redis
[leetcode169] most elements
[leetcode 202] happy number
11.a==b?
Conversion between JS object and string
[leetcode 290] word rules
[leetcode 54] spiral matrix
Rust 中的 RefCell
Robocode教程3——Robo机器剖析
Optional best practices
解决ArcGIS分区统计显示太多唯一值执行失败
Animation - Introduction to keyframes
Troubleshooting of data deleted and reappeared problems
Rust 的 Box指针
队列解决约瑟夫问题
7.Domino piling
Addition, deletion, query and modification of data
POJ - 2955 brackets interval DP
线程和进程的关系和区别是什么
Understanding and installing MySQL









