private <T> Page<T> listToPage(List<T> dataList, Integer pageSize, Integer pageNumber){
Page<T> result = new Page<T>();
List<T> monitors = new ArrsyList<T>();
if(dataList!=null && dataList.size()>0){
int currentIndex = pageNumber>1?(pageNumber-1)*pageSize:0;
for(int i=0; i<pageSize &&i<dataList.size()-currentIndex;i++){
T data = dataList.get(currentIndex +i);
monitors.add(data);
}
result.addAll(monitors);
result.setTotal(dataList.size());
result.setPageNum(pageNumber);
result.setPageSize(pageSize);
result.setReasonable(true);
}
return result;
}
04-20
259
10-15
1052
01-12
2470
07-29
7607
01-21
2563
12-25
2002