package com.vincent.template.recycler.bean;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * 分页信息 默认一页10条
 */
public  class PageBean
        implements Parcelable {
    private int page=0;
    private int rows=10;
    private int totalCount;
    private int totalPage;
    private boolean refresh=true;


    public int getLoadPage() {
        if(refresh){
            return  page=1;
        }
        return ++page;
    }

    public int getPage() {
        return page;
    }

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

    public int getRows() {
        return rows;
    }

    public void setRows(int rows) {
        this.rows = rows;
    }

    public int getTotalCount() {
        return totalCount;
    }

    public void setTotalCount(int totalCount) {
        this.totalCount = totalCount;
    }

    public int getTotalPage() {
        return totalPage;
    }

    public void setTotalPage(int totalPage) {
        this.totalPage = totalPage;
    }

    public boolean isRefresh() {
        return refresh;
    }

    public void setRefresh(boolean refresh) {
        this.refresh = refresh;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(this.page);
        dest.writeInt(this.rows);
        dest.writeInt(this.totalCount);
        dest.writeInt(this.totalPage);
        dest.writeByte(refresh ? (byte) 1 : (byte) 0);
    }

    public PageBean() {
    }

    protected PageBean(Parcel in) {
        this.page = in.readInt();
        this.rows = in.readInt();
        this.totalCount = in.readInt();
        this.totalPage = in.readInt();
        this.refresh = in.readByte() != 0;
    }

    public static final Creator<PageBean> CREATOR = new Creator<PageBean>() {
        @Override
        public PageBean createFromParcel(Parcel source) {
            return new PageBean(source);
        }

        @Override
        public PageBean[] newArray(int size) {
            return new PageBean[size];
        }
    };
}
@@ -106,20 +106,276 @@
 %0A * 
-%E5%88%86%E9%A1%B5%E4%BF%A1%E6%81%AF %E9%BB%98%E8%AE%A4%E4%B8%80%E9%A1%B510%E6%9D%A1
+packageName:%09    com.vincent.template.recycler.bean%0A * className:%09    PageBean%0A * author:%09        Luoxiang%0A * time:%09        2017/6/8%0914:06%0A * desc:%09        %E5%88%86%E9%A1%B5%E4%BF%A1%E6%81%AF %E9%BB%98%E8%AE%A4%E4%B8%80%E9%A1%B510%E6%9D%A1%0A *%0A * svnVersion:%0A * upDateAuthor:    Vincent%0A * upDate:          2017/6/8%0A * upDateDesc:      TODO
 %0A */

add page bean