public class BaseResponse<T> {
private PageBean<T> page;
public static class PageBean<T> {
private List<T> list;
}
}
BaseResponse<Bean> bean = JSON.parseObject(json,
new TypeReference<BaseResponse<Bean>>() {
});
bean.getPage().getList(); // 得到的是空
错误:
java.lang.NullPointerException: Attempt to invoke virtual method 'java.util.List BaseResponse$PageBean.getList()' on a null object reference
我该怎么序列化?
暂无答案!
目前还没有任何答案,快来回答吧!