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

com.github.linushp.commons.model.Page Maven / Gradle / Ivy

package com.github.linushp.commons.model;

import java.util.List;

public class Page {

    private List items;
    private long itemsCount;
    private long pagesCount;
    private int pageNo;
    private int pageSize;

    public Page(List dataList, long totalCount, int pageNo, int pageSize) {

        this.items = dataList;
        this.itemsCount = totalCount;
        this.pageNo = pageNo;
        this.pageSize = pageSize;


        this.pagesCount = totalCount / pageSize;
        if (totalCount % pageSize > 0) {
            this.pagesCount = this.pagesCount + 1;
        }

    }


    public List getItems() {
        return items;
    }

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

    public long getItemsCount() {
        return itemsCount;
    }

    public void setItemsCount(long itemsCount) {
        this.itemsCount = itemsCount;
    }

    public long getPagesCount() {
        return pagesCount;
    }

    public void setPagesCount(long pagesCount) {
        this.pagesCount = pagesCount;
    }

    public int getPageNo() {
        return pageNo;
    }

    public void setPageNo(int pageNo) {
        this.pageNo = pageNo;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy