List<Pipeline> subList = newPipelineList.subList(fromIndex, toIndex);
Pageable pageable = new PageRequest(page, size);
Page<Pipeline> pipelinePage = new PageImpl<>(subList, pageable, count);
return new PageInfo<>(pipelinePage);
subList 是分页后的集合
pageable 是“页码”和“每页多少条数据”
count 是数据总条数
参考:https://www.cnblogs.com/lxxcn/p/12517768.html
最后
以上就是爱笑长颈鹿最近收集整理的关于List类型的集合转换为Page类型的方法的全部内容,更多相关List类型内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复