PageListResp.java 2.02 KB
package com.example.demo;


import java.util.List;

/**
 * 描述:
 * Created by pangjie@yoho.cn on 2017/6/20.
 */
public class PageListResp<T> {

    private int iTotalRecords;

    private int iTotalDisplayRecords;

    private int length;

    /**
     * 数据
     */
    private List<T> aaData;

    private PageListResp(Builder builder) {
        setiTotalRecords(builder.iTotalRecords);
        setiTotalDisplayRecords(builder.iTotalDisplayRecords);
        setLength(builder.length);
        setAaData(builder.aaData);
    }

    public static Builder newBuilder() {
        return new Builder();
    }

    public int getiTotalRecords() {
        return iTotalRecords;
    }

    public void setiTotalRecords(int iTotalRecords) {
        this.iTotalRecords = iTotalRecords;
    }

    public int getiTotalDisplayRecords() {
        return iTotalDisplayRecords;
    }

    public void setiTotalDisplayRecords(int iTotalDisplayRecords) {
        this.iTotalDisplayRecords = iTotalDisplayRecords;
    }

    public List<T> getAaData() {
        return aaData;
    }

    public void setAaData(List<T> aaData) {
        this.aaData = aaData;
    }

    public int getLength() {
        return length;
    }

    public void setLength(int length) {
        this.length = length;
    }

    public static final class Builder<T> {
        private int iTotalRecords;
        private int iTotalDisplayRecords;
        private int length;
        private List<T> aaData;

        private Builder() {
        }

        public Builder iTotalRecords(int val) {
            iTotalRecords = val;
            return this;
        }

        public Builder iTotalDisplayRecords(int val) {
            iTotalDisplayRecords = val;
            return this;
        }

        public Builder length(int val) {
            length = val;
            return this;
        }

        public Builder aaData(List<T> val) {
            aaData = val;
            return this;
        }

        public PageListResp build() {
            return new PageListResp(this);
        }
    }
}