标签:new json格式 ToJson uil public span string tin div
public class GsonUtil { /** * 将object对象转成json格式字符串 */ public static String toJson(Object object) { GsonBuilder gsonBuilder = new GsonBuilder(); gsonBuilder.setPrettyPrinting(); Gson gson = gsonBuilder.create(); return gson.toJson(object); } }
测试工具类,将使用谷歌的gson将object对象转成josn对象
标签:new json格式 ToJson uil public span string tin div
原文地址:https://www.cnblogs.com/qingmuchuanqi48/p/11628978.html