/*
* 截取列表
*/
public static <T> List<T> getSubListPage(List<T> list, int skip,
int pageSize) {
if (list == null || list.isEmpty()) {
return null;
}
int startIndex = skip;
int endIndex = skip + pageSize;
if (startIndex > endIndex || startIndex > list.size()) {
return null;
}
if (endIndex > list.size()) {
endIndex = list.size();
}
return list.subList(startIndex, endIndex);
}
list 截取固定条数
最新推荐文章于 2024-06-29 02:58:04 发布