Gson转JSON数组到List

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/Lemostic/article/details/79913897

将一个Person的json数组转为java的list集合,使用如下方法:

Gson gson = new Gson();
List<Person> statusLs = gson.fromJson(result, new TypeToken<List<Person>>(){}.getType());

猜你喜欢

转载自blog.csdn.net/Lemostic/article/details/79913897