java - fastjson如何反序列化为泛型数组
迷茫
迷茫 2017-04-17 16:54:36
0
2
358
迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

reply all(2)
Peter_Zhu

First of all, the method written in jsonToList is definitely wrong, because although you wrote a generic, you did not use the clazz that the generic depends on, so it is impossible to convert it into the class you want anyway. The parseObject method TypeReference is already generic. You cannot use generics to apply generics. In addition, the purpose of the question is just to make the code look simpler, just new TypeReference<List<SomeBean>>(){ }The difference between it and SomeBean.class is just one sentence of code. Maybe what I said is wrong, but I don't think there is any need to change it.

迷茫

Find a parseArray method that can be used

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!