2 Copyright (c) 2007-2009, Yusuke Yamamoto
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions are met:
7 * Redistributions of source code must retain the above copyright
8 notice, this list of conditions and the following disclaimer.
9 * Redistributions in binary form must reproduce the above copyright
10 notice, this list of conditions and the following disclaimer in the
11 documentation and/or other materials provided with the distribution.
12 * Neither the name of the Yusuke Yamamoto nor the
13 names of its contributors may be used to endorse or promote products
14 derived from this software without specific prior written permission.
16 THIS SOFTWARE IS PROVIDED BY Yusuke Yamamoto ``AS IS'' AND ANY
17 EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 DISCLAIMED. IN NO EVENT SHALL Yusuke Yamamoto BE LIABLE FOR ANY
20 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 package weibo4android
;
30 * Controlls pagination
32 * @author Yusuke Yamamoto - yusuke at mac.com
34 public class Paging
implements java
.io
.Serializable
{
35 private int page
= -1;
36 private int count
= -1;
37 private long sinceId
= -1;
38 private long maxId
= -1;
39 private static final long serialVersionUID
= -3285857427993796670L;
44 public Paging(int page
) {
48 public Paging(long sinceId
) {
52 public Paging(int page
, int count
) {
56 public Paging(int page
, long sinceId
) {
61 public Paging(int page
, int count
, long sinceId
) {
66 public Paging(int page
, int count
, long sinceId
, long maxId
) {
67 this(page
, count
, sinceId
);
71 public int getPage() {
75 public void setPage(int page
) {
77 throw new IllegalArgumentException("page should be positive integer. passed:" + page
);
82 public int getCount() {
86 public void setCount(int count
) {
88 throw new IllegalArgumentException("count should be positive integer. passed:" + count
);
93 public Paging
count(int count
) {
98 public long getSinceId() {
102 public void setSinceId(int sinceId
) {
104 throw new IllegalArgumentException("since_id should be positive integer. passed:" + sinceId
);
106 this.sinceId
= sinceId
;
109 public Paging
sinceId(int sinceId
) {
114 public void setSinceId(long sinceId
) {
116 throw new IllegalArgumentException("since_id should be positive integer. passed:" + sinceId
);
118 this.sinceId
= sinceId
;
121 public Paging
sinceId(long sinceId
) {
126 public long getMaxId() {
130 public void setMaxId(long maxId
) {
132 throw new IllegalArgumentException("max_id should be positive integer. passed:" + maxId
);
137 public Paging
maxId(long maxId
) {