package <%= packageName %>.util.web;

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

public class PageData<T> {
    private long total = 0;

    private int page = 0;

    private int size = 15;

    private List<T> records = new ArrayList<>();

    public PageData() {
    }

    public PageData(long total, List<T> records, int page, int size) {
        this.total = total;
        this.records = records;
        this.page = page;
        this.size = size;
    }

    public long getTotal() {
        return total;
    }

    public void setTotal(long total) {
        this.total = total;
    }

    public int getSize() {
        return size;
    }

    public void setSize(int size) {
        this.size = size;
    }

    public List<T> getRecords() {
        return records;
    }

    public void setRecords(List<T> records) {
        this.records = records;
    }

    public int getPage() {
        return page;
    }

    public void setPage(int page) {
        this.page = page;
    }

    public PageData<T> records(List<T> records) {
        this.records = records;
        return this;
    }

    public PageData<T> total(long total) {
        this.total = total;
        return this;
    }

    public PageData<T> size(int size) {
        this.size = size;
        return this;
    }

    public PageData<T> page(int page) {
        this.page = page;
        return this;
    }
}
