package com.zhaohaoting.framework.abs.entity;

import java.util.ArrayList;
import java.util.List;

/**
 * author：Created by ZHT on 2017/11/14 17:38
 * email：526309416@qq.com
 * desc：
 */
public class BaseListEntity<T> {
    private int pageSize;
    private List<T> list;

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public void setList(List<T> list) {
        this.list = list;
    }

    public BaseListEntity() {
        list = new ArrayList<>();
    }

    public int getPageSize() {
        return pageSize;
    }

    public List<T> getRows() {
        if (list == null) {
            return list = new ArrayList<T>();
        }
        return list;
    }

    public void setRows(List<T> rows) {
        if (this.list.size() > 0) {
            this.list.clear();
        }
        this.list.addAll(rows);
    }
}
