All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.bixuebihui.PageModel Maven / Gradle / Ivy

There is a newer version: 1.15.9
Show newest version
package com.bixuebihui;

import java.io.Serializable;
import java.util.List;

/**
 * @author xwx
 */
public class PageModel implements Serializable {
    private long total;
    private List items;
    /**
     * 执行时长
     */
    private long took;

    private PageModel() {
    }

    public static  Builder builder(List data) {
        return new Builder().data(data);
    }


    public long getTotal() {
        return total;
    }

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

    public List getItems() {
        return items;
    }

    public void setItems(List items) {
        this.items = items;
    }

    /**
     * 获取 执行时长
     */
    public long getTook() {
        return this.took;
    }

    /**
     * 设置 执行时长
     */
    public void setTook(long took) {
        this.took = took;
    }


    public static class Builder {
        private List data;
        private long total;
        private int took;

        private Builder() {
            this.total = 0;
        }

        public Builder total(long total) {
            this.total = total;
            return this;
        }

        public Builder took(int took) {
            this.took = took;
            return this;
        }

        public Builder data(List data) {
            this.data = data;
            return this;
        }

        public PageModel build() {
            PageModel pager = new PageModel();
            pager.setTotal(total);
            pager.setItems(data);
            pager.setTook(took);
            return pager;
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy