.ClassCastException: com.google.gson.internal.LinkedTreeMap cannot be cast to
2016-03-02 15:22
1001 查看
这种是类型转换中断。
DataEntity 也必须要加<T>, 不光List<T>
否则类型转换会在 DataEntity 中断,导致类型转换异常。
DataEntity 也必须要加<T>, 不光List<T>
否则类型转换会在 DataEntity 中断,导致类型转换异常。
private DataEntity<T> data; @Override public String toString() { return "BaseResults{" + "data=" + data + '}'; } public DataEntity<T> getData() { return data; } public List<T> getList() { return data.rows; } public class DataEntity<T> { @Override public String toString() { return "DataEntity{" + "total=" + total + ", rows=" + rows + '}'; } private int total; private List<T> rows; public void setTotal(int total) { this.total = total; } public void setRows(List<T> rows) { this.rows = rows; } public int getTotal() { return total; } public List<T> getRows() { return rows; } }
相关文章推荐
- Google Guava Cache:本地缓存,过期实现
- Golang在视频直播平台的高性能实践
- Django~学习计划
- Django~待解决的问题
- Django~Databases
- [golang note] 函数定义
- google大法!
- django的模板页面里,如何获取一个集合的数据?
- golang笔记——struct
- 64.View the Exhibit and examine the data in the PROMO_CATEGORY and PROMO_COST columns of
- Windows 下用 gogs 配置局域网 git server
- golang的连接池例子
- 原创翻译:James Whittaker系列——Google是如何测试的(3)
- 1.NSString+category
- Fcitx下的Google拼音和云拼音
- VIEWGOOD(远古)电力行业流媒体项目
- [Google EarlGrey] 0x02 API 简介
- django1.9使用django-pageination出现AttributeError错误处理
- Euclid‘s algorithm
- SGOI 海上搜索 状压DP