|
| 1 | +package graphql.relay; |
| 2 | + |
| 3 | +public class DefaultPageInfo implements PageInfo { |
| 4 | + |
| 5 | + private ConnectionCursor startCursor; |
| 6 | + private ConnectionCursor endCursor; |
| 7 | + private boolean hasPreviousPage; |
| 8 | + private boolean hasNextPage; |
| 9 | + |
| 10 | + @Override |
| 11 | + public ConnectionCursor getStartCursor() { |
| 12 | + return startCursor; |
| 13 | + } |
| 14 | + |
| 15 | + public void setStartCursor(ConnectionCursor startCursor) { |
| 16 | + this.startCursor = startCursor; |
| 17 | + } |
| 18 | + |
| 19 | + @Override |
| 20 | + public ConnectionCursor getEndCursor() { |
| 21 | + return endCursor; |
| 22 | + } |
| 23 | + |
| 24 | + public void setEndCursor(ConnectionCursor endCursor) { |
| 25 | + this.endCursor = endCursor; |
| 26 | + } |
| 27 | + |
| 28 | + @Override |
| 29 | + public boolean isHasPreviousPage() { |
| 30 | + return hasPreviousPage; |
| 31 | + } |
| 32 | + |
| 33 | + public void setHasPreviousPage(boolean hasPreviousPage) { |
| 34 | + this.hasPreviousPage = hasPreviousPage; |
| 35 | + } |
| 36 | + |
| 37 | + @Override |
| 38 | + public boolean isHasNextPage() { |
| 39 | + return hasNextPage; |
| 40 | + } |
| 41 | + |
| 42 | + public void setHasNextPage(boolean hasNextPage) { |
| 43 | + this.hasNextPage = hasNextPage; |
| 44 | + } |
| 45 | + |
| 46 | + @Override |
| 47 | + public String toString() { |
| 48 | + final StringBuilder sb = new StringBuilder("DefaultPageInfo{"); |
| 49 | + sb.append("startCursor=").append(startCursor); |
| 50 | + sb.append(", endCursor=").append(endCursor); |
| 51 | + sb.append(", hasPreviousPage=").append(hasPreviousPage); |
| 52 | + sb.append(", hasNextPage=").append(hasNextPage); |
| 53 | + sb.append('}'); |
| 54 | + return sb.toString(); |
| 55 | + } |
| 56 | +} |
0 commit comments