package com.fzm.mall.server.front.base;

//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//


import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.List;

@ApiModel("基本分页信息")
public class PageVO<T> {
    @ApiModelProperty("当前页号")
    private Integer page;
    @ApiModelProperty("每页行数")
    private Integer size;
    @ApiModelProperty("总页数")
    private Integer totalPage;
    @ApiModelProperty("总行数")
    private Integer totalSize;
    @ApiModelProperty("是否有下一页，0：没有，1：有")
    private Integer isMore;
    @ApiModelProperty("分页结果数据")
    private List<T> data;

    public void init(Integer page, Integer size, Integer totalSize, List<T> list) {
        this.page = page;
        this.size = size;
        this.totalSize = totalSize;
        this.totalPage = totalSize % size > 0 ? totalSize / size + 1 : totalSize / size;
        this.isMore = page < this.totalPage ? 1 : 0;
        this.data = list;
    }

    public PageVO() {
    }

    public Integer getPage() {
        return this.page;
    }

    public Integer getSize() {
        return this.size;
    }

    public Integer getTotalPage() {
        return this.totalPage;
    }

    public Integer getTotalSize() {
        return this.totalSize;
    }

    public Integer getIsMore() {
        return this.isMore;
    }

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

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

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

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

    public void setTotalSize(final Integer totalSize) {
        this.totalSize = totalSize;
    }

    public void setIsMore(final Integer isMore) {
        this.isMore = isMore;
    }

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

    public boolean equals(final Object o) {
        if (o == this) {
            return true;
        } else if (!(o instanceof com.fzm.mall.server.front.base.PageVO)) {
            return false;
        } else {
            com.fzm.mall.server.front.base.PageVO<?> other = (com.fzm.mall.server.front.base.PageVO)o;
            if (!other.canEqual(this)) {
                return false;
            } else {
                Object this$page = this.getPage();
                Object other$page = other.getPage();
                if (this$page == null) {
                    if (other$page != null) {
                        return false;
                    }
                } else if (!this$page.equals(other$page)) {
                    return false;
                }

                Object this$size = this.getSize();
                Object other$size = other.getSize();
                if (this$size == null) {
                    if (other$size != null) {
                        return false;
                    }
                } else if (!this$size.equals(other$size)) {
                    return false;
                }

                Object this$totalPage = this.getTotalPage();
                Object other$totalPage = other.getTotalPage();
                if (this$totalPage == null) {
                    if (other$totalPage != null) {
                        return false;
                    }
                } else if (!this$totalPage.equals(other$totalPage)) {
                    return false;
                }

                label62: {
                    Object this$totalSize = this.getTotalSize();
                    Object other$totalSize = other.getTotalSize();
                    if (this$totalSize == null) {
                        if (other$totalSize == null) {
                            break label62;
                        }
                    } else if (this$totalSize.equals(other$totalSize)) {
                        break label62;
                    }

                    return false;
                }

                label55: {
                    Object this$isMore = this.getIsMore();
                    Object other$isMore = other.getIsMore();
                    if (this$isMore == null) {
                        if (other$isMore == null) {
                            break label55;
                        }
                    } else if (this$isMore.equals(other$isMore)) {
                        break label55;
                    }

                    return false;
                }

                Object this$data = this.getData();
                Object other$data = other.getData();
                if (this$data == null) {
                    if (other$data != null) {
                        return false;
                    }
                } else if (!this$data.equals(other$data)) {
                    return false;
                }

                return true;
            }
        }
    }

    protected boolean canEqual(final Object other) {
        return other instanceof com.fzm.mall.server.front.base.PageVO;
    }

    public int hashCode() {
        int result = 1;
        Object $page = this.getPage();
        result = result * 59 + ($page == null ? 43 : $page.hashCode());
        Object $size = this.getSize();
        result = result * 59 + ($size == null ? 43 : $size.hashCode());
        Object $totalPage = this.getTotalPage();
        result = result * 59 + ($totalPage == null ? 43 : $totalPage.hashCode());
        Object $totalSize = this.getTotalSize();
        result = result * 59 + ($totalSize == null ? 43 : $totalSize.hashCode());
        Object $isMore = this.getIsMore();
        result = result * 59 + ($isMore == null ? 43 : $isMore.hashCode());
        Object $data = this.getData();
        result = result * 59 + ($data == null ? 43 : $data.hashCode());
        return result;
    }

    public String toString() {
        return "PageVO(page=" + this.getPage() + ", size=" + this.getSize() + ", totalPage=" + this.getTotalPage() + ", totalSize=" + this.getTotalSize() + ", isMore=" + this.getIsMore() + ", data=" + this.getData() + ")";
    }
}
