Java List分页

List<TerminalStoreRepeatDto> pageNewData=new ArrayList<>();
int currIdx = (page.getPageNumber() > 0 ? page.getPageNumber() * page.getPageSize() : 0);
for (int i = 0; i < page.getPageSize() && i < terminalStoreRepeatDtoList.size() - currIdx; i++) {
TerminalStoreRepeatDto terminalStoreRepeatDto = terminalStoreRepeatDtoList.get(currIdx + i);
pageNewData.add(terminalStoreRepeatDto);
}
PageImpl<TerminalStoreRepeatDto> pageData = new PageImpl<TerminalStoreRepeatDto>(pageNewData,page,terminalStoreRepeatDtoList.size());
posted @ 2018-11-29 17:58  Logan_626  阅读(392)  评论(0编辑  收藏  举报