当前位置:网站首页>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
边栏推荐
- Sakura substring thinking
- DBCP usage
- Explanation of login page
- 爬取手游网站游戏详情和评论(MQ+多线程)
- Kibana search syntax
- Generate excel template (drop-down selection, multi-level linkage)
- Collections multiple parameter sorting
- PHP processing JSON_ Decode() parses JSON stringify
- The problem that the page will refresh automatically after clicking the submit button on the form is solved
- Example of ticket selling with reentrant lock
猜你喜欢
7-21日错题涉及知识点。
MySQL table constraints and table design
lambda expressions
線性代數第二章-矩陣及其運算
C language file operation
Kalman filter and inertial integrated navigation
Type conversion in C #
A sharp tool to improve work efficiency
Explain of MySQL optimization
Algèbre linéaire chapitre 2 - matrice et son fonctionnement
随机推荐
6.Reversal
Doomsday (simple computational geometry)
scikit-learn sklearn 0.18 官方文档中文版
Motor and drive (Qi Jinqing Edition)
Supply chain service terms
MySQL occasional Caton
Three ways to create threads
MySQL advanced query
Cf515b drazil and his happy friends
[leetcode169] most elements
Understanding and installing MySQL
POJ - 2955 brackets interval DP
Techniques et principes de détection
Event listener
Algèbre linéaire chapitre 1 - déterminants
IO multiplexing of 09 redis
Kalman filter and inertial integrated navigation
SQL optimization best practices
Rust 中的 RefCell
Mysql database foundation