gson学习笔记
1. 字符串转JsonObject
JsonObject origJson = new JsonParser().parse(str).getAsJsonObject();
2. JsonObject转字符串
String str = outputJson.toString();
3. List转JsonArray
JsonArray array = new Gson().toJsonTree(list).getAsJsonArray();
本文只发表于博客园和tonglin0325的博客,作者:tonglin0325,转载请注明原文链接:https://www.cnblogs.com/tonglin0325/p/5235290.html