shikeying
2024-01-11 3b67e947e36133e2a40eb2737b15ea375e157ea0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package com.walker.db.page;
 
import java.util.List;
import java.util.Map;
 
/**
 * 带<code>Map</code>类型的分页实现,业务数据为Map集合。</p>
 * @author shikeying
 *
 */
public class MapPager extends GenericPager<Map<String, Object>> {
 
    public MapPager(List<Map<String, Object>> datas
            , int pageIndex, int pageSize, int totalRows){
        super(datas, pageIndex, pageSize, totalRows);
    }
    
    @Override
    protected Class<?> buildData() {
        return List.class;
    }
    
    public MapPager setDatas(List<Map<String, Object>> datas){
        if(this.datas != null){
            throw new IllegalStateException("datas is not empty.");
        }
        if(datas != null){
            this.datas = datas;
        }
        return this;
    }
 
}