| 1 | |
|
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
|
| 16 | |
|
| 17 | |
|
| 18 | |
package org.apache.shindig.social.opensocial.spi; |
| 19 | |
|
| 20 | |
import java.util.List; |
| 21 | |
|
| 22 | |
public class RestfulCollection<T> { |
| 23 | |
private List<T> entry; |
| 24 | |
private int startIndex; |
| 25 | |
private int totalResults; |
| 26 | |
|
| 27 | 27 | private boolean filtered = true; |
| 28 | 27 | private boolean sorted = true; |
| 29 | 27 | private boolean updatedSince = true; |
| 30 | |
|
| 31 | |
public RestfulCollection(List<T> entry) { |
| 32 | 18 | this(entry, 0, entry.size()); |
| 33 | 18 | } |
| 34 | |
|
| 35 | 27 | public RestfulCollection(List<T> entry, int startIndex, int totalResults) { |
| 36 | 27 | this.entry = entry; |
| 37 | 27 | this.startIndex = startIndex; |
| 38 | 27 | this.totalResults = totalResults; |
| 39 | 27 | } |
| 40 | |
|
| 41 | |
public List<T> getEntry() { |
| 42 | 19 | return entry; |
| 43 | |
} |
| 44 | |
|
| 45 | |
public void setEntry(List<T> entry) { |
| 46 | 1 | this.entry = entry; |
| 47 | 1 | } |
| 48 | |
|
| 49 | |
public int getStartIndex() { |
| 50 | 15 | return startIndex; |
| 51 | |
} |
| 52 | |
|
| 53 | |
public void setStartIndex(int startIndex) { |
| 54 | 1 | this.startIndex = startIndex; |
| 55 | 1 | } |
| 56 | |
|
| 57 | |
public int getTotalResults() { |
| 58 | 19 | return totalResults; |
| 59 | |
} |
| 60 | |
|
| 61 | |
public void setTotalResults(int totalResults) { |
| 62 | 1 | this.totalResults = totalResults; |
| 63 | 1 | } |
| 64 | |
|
| 65 | |
public boolean isFiltered() { |
| 66 | 6 | return filtered; |
| 67 | |
} |
| 68 | |
|
| 69 | |
public void setFiltered(boolean filtered) { |
| 70 | 0 | this.filtered = filtered; |
| 71 | 0 | } |
| 72 | |
|
| 73 | |
public boolean isSorted() { |
| 74 | 6 | return sorted; |
| 75 | |
} |
| 76 | |
|
| 77 | |
public void setSorted(boolean sorted) { |
| 78 | 0 | this.sorted = sorted; |
| 79 | 0 | } |
| 80 | |
|
| 81 | |
public boolean isUpdatedSince() { |
| 82 | 6 | return updatedSince; |
| 83 | |
} |
| 84 | |
|
| 85 | |
public void setUpdatedSince(boolean updatedSince) { |
| 86 | 0 | this.updatedSince = updatedSince; |
| 87 | 0 | } |
| 88 | |
} |