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

io.github.jinghui70.rainbow.dbaccess.PageData Maven / Gradle / Ivy

There is a newer version: 5.2.1
Show newest version
package io.github.jinghui70.rainbow.dbaccess;

import cn.hutool.json.JSONUtil;

import java.util.Collections;
import java.util.List;

/**
 * 分页查询用数据封装对象
 *
 * @param  对象的泛型
 */
public class PageData {

    /**
     * 查询的总记录数
     */
    private int total;

    /**
     * 查询的结果列表
     */
    private List rows;

    public PageData() {
        rows = Collections.emptyList();
    }

    public PageData(int total) {
        this.total = total;
        rows = Collections.emptyList();
    }

    public PageData(int total, List rows) {
        this.total = total;
        this.rows = rows;
    }

    public int getTotal() {
        return total;
    }

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

    public List getRows() {
        return rows;
    }

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

    @Override
    public String toString() {
        return JSONUtil.toJsonStr(this);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy