Gson使用 将json数据转换为List 对象数组

一、导入依赖

implementation ‘com.google.code.gson:gson:2.8.6’

实例使用

Gson gson = new Gson();
List<StudentInfo> studentInfoList = gson.fromJson(requestBody.string(),
new TypeToken<List<StudentInfo>>() {}.getType());
发布了261 篇原创文章 · 获赞 122 · 访问量 6万+

猜你喜欢

转载自blog.csdn.net/weixin_43889841/article/details/104494895