1.请求传参
String.class
2.方法接收
Class<T> classOfT
3.类型转换
Type type = TypeToken.getParameterized(BaseDataBean.class, classOfT).getType();
4.json字符串转Bean
BaseDataBean<T> data = new Gson().fromJson(encryptStr, type);
5.附上代码
1.请求传参
String.class
2.方法接收
Class<T> classOfT
3.类型转换
Type type = TypeToken.getParameterized(BaseDataBean.class, classOfT).getType();
4.json字符串转Bean
BaseDataBean<T> data = new Gson().fromJson(encryptStr, type);
5.附上代码