001
002/*
003 * Copyright (C) 2011 Archie L. Cobbs. All rights reserved.
004 *
005 * $Id$
006 */
007
008package org.dellroad.jibxbindings.twilio.restapi;
009
010import java.net.URI;
011
012/**
013 * Abstract superclass for XML represenations of one page in a list of REST resources.
014 */
015public abstract class Page {
016
017    private int page;
018    private int numPages;
019    private int pageSize;
020    private int total;
021    private int start;
022    private int end;
023    private URI uri;
024    private URI firstPageURI;
025    private URI nextPageURI;
026    private URI previousPageURI;
027    private URI lastPageURI;
028
029    /**
030     * Current page number. Starts at zero.
031     */
032    public int getPage() {
033        return this.page;
034    }
035    public void setPage(int page) {
036        this.page = page;
037    }
038
039    /**
040     * Total number of pages.
041     */
042    public int getNumPages() {
043        return this.numPages;
044    }
045    public void setNumPages(int numPages) {
046        this.numPages = numPages;
047    }
048
049    /**
050     * Number of items in each page.
051     */
052    public int getPageSize() {
053        return this.pageSize;
054    }
055    public void setPageSize(int pageSize) {
056        this.pageSize = pageSize;
057    }
058
059    /**
060     * Total number of items in the list.
061     */
062    public int getTotal() {
063        return this.total;
064    }
065    public void setTotal(int total) {
066        this.total = total;
067    }
068
069    /**
070     * The position in the overall list of the first item in this page.
071     */
072    public int getStart() {
073        return this.start;
074    }
075    public void setStart(int start) {
076        this.start = start;
077    }
078
079    /**
080     * The position in the overall list of the last item in this page.
081     */
082    public int getEnd() {
083        return this.end;
084    }
085    public void setEnd(int end) {
086        this.end = end;
087    }
088
089    /**
090     * The URI of the current page.
091     */
092    public URI getURI() {
093        return this.uri;
094    }
095    public void setURI(URI uri) {
096        this.uri = uri;
097    }
098
099    /**
100     * The URI for the first page of this list.
101     */
102    public URI getFirstPageURI() {
103        return this.firstPageURI;
104    }
105    public void setFirstPageURI(URI firstPageURI) {
106        this.firstPageURI = firstPageURI;
107    }
108
109    /**
110     * The URI for the next page of this list.
111     */
112    public URI getNextPageURI() {
113        return this.nextPageURI;
114    }
115    public void setNextPageURI(URI nextPageURI) {
116        this.nextPageURI = nextPageURI;
117    }
118
119    /**
120     * The URI for the previous page of this list.
121     */
122    public URI getPreviousPageURI() {
123        return this.previousPageURI;
124    }
125    public void setPreviousPageURI(URI previousPageURI) {
126        this.previousPageURI = previousPageURI;
127    }
128
129    /**
130     * The URI for the last page of this list.
131     */
132    public URI getLastPageURI() {
133        return this.lastPageURI;
134    }
135    public void setLastPageURI(URI lastPageURI) {
136        this.lastPageURI = lastPageURI;
137    }
138}
139