概述
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类型的集合转换为Page类型的方法所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复