Java List分頁
阿新 • • 發佈:2018-11-29
number als enum arraylist size imp ges nal dto
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());
Java List分頁