我是靠谱客的博主 爱笑长颈鹿,这篇文章主要介绍List类型的集合转换为Page类型的方法,现在分享给大家,希望可以做个参考。

	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类型内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(60)

评论列表共有 0 条评论

立即
投稿
返回
顶部