解析成为集合
List<Student> retList = gson.fromJson(string, new TypeToken<List<Student>>() {}.getType());
解析成为map
Map<String, String> map = gson.fromJson(rebate, new TypeToken<Map<String, String>>() {}.getType());
解析成为集合
List<Student> retList = gson.fromJson(string, new TypeToken<List<Student>>() {}.getType());
解析成为map
Map<String, String> map = gson.fromJson(rebate, new TypeToken<Map<String, String>>() {}.getType());
本文标题:Gson直接降json数据解析成集合和map
本文链接:https://www.haomeiwen.com/subject/nfwayqtx.html
网友评论