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.
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