gson 提供方法 TypeToken<?> getParameterized(Type rawType, Type... typeArguments) 进行泛型转化:
- final Class<? super T> rawType; 基类信息
- final Type type; 底层反射实例
public static void main(String[] args) {
Map data1 = new HashMap<>();
data1.put("id", 11L);
data1.put("name", "dl");
data1.put("desc", "for test");
Map data2 = new HashMap<>();
data2.put("id", 112L);
data2.put("name", "dl2");
data2.put("desc", "for test2");
List