package com.wisewoods.base.page;

import java.util.List;

public class PageInfo<T> {

    public long page = 1;
    public long size = 10;

    public long currentSize() {
        return page * size;
    }

    public void nextPage() {
        page++;
    }

    public void reset() {
        page = 1;
    }

    public boolean isFirstPage() {
        return page == 1;
    }


    private List<T> data;
    private long total;

    public List<T> getData() {
        return data;
    }

    public void setData(List<T> data) {
        this.data = data;
    }

    public void addData(List<T> data) {
        if (this.data != null) {
            this.data.addAll(data);
        } else {
            this.data = data;
        }
    }

    public long getTotal() {
        return total;
    }

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