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

com.wadpam.gaelic.json.JCursorPage Maven / Gradle / Ivy

The newest version!
package com.wadpam.gaelic.json;

import java.io.Serializable;
import java.util.Collection;

/**
 * Json object for a pages of items.
 * @author mattiaslevin
 */
public class JCursorPage implements Serializable {

    /**
     * The cursor used to return the next page of items
     * The no cursor is returned, end of pagination have been reached
     */
    private String cursorKey;

    /**
     * The number of items to return.
     * If the number of items actually returned are less then the requested page size, end of pagination have been reached.
     */
    private int pageSize;
    
    /**
     * The total number of items available. Use for progress indication.
     */
    private Integer totalSize;

    /** The items */
    private Collection items;

    @Override
    public String toString() {
        return String.format("JCursorPage{cursorKey:%s, pageSize:%d, totalSize:%d}", cursorKey, pageSize, totalSize);
    }

    // Setters and getters

    public String getCursorKey() {
        return cursorKey;
    }

    public void setCursorKey(String cursorKey) {
        this.cursorKey = cursorKey;
    }

    public Collection getItems() {
        return items;
    }

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

    public int getPageSize() {
        return pageSize;
    }

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

    public Integer getTotalSize() {
        return totalSize;
    }

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy