|
| 1 | +package org.zendesk.client.v2.model.views; |
| 2 | + |
| 3 | +import com.fasterxml.jackson.annotation.JsonProperty; |
| 4 | +import java.io.Serializable; |
| 5 | +import java.util.List; |
| 6 | +import java.util.Objects; |
| 7 | + |
| 8 | +// this is somewhat similar to a Page but with a single ExecuteView object and not a list |
| 9 | +// hence why we cannot inherite Page<?> |
| 10 | +public class ExecutedViewPage<V extends ViewRow> implements Serializable { |
| 11 | + private static final long serialVersionUID = -7683989282890282540L; |
| 12 | + |
| 13 | + private @JsonProperty("next_page") String nextPage; |
| 14 | + private @JsonProperty("previous_page") String previousPage; |
| 15 | + private int count; |
| 16 | + |
| 17 | + private List<ViewColumn> columns; |
| 18 | + private List<V> rows; |
| 19 | + |
| 20 | + public List<ViewColumn> getColumns() { |
| 21 | + return columns; |
| 22 | + } |
| 23 | + |
| 24 | + public void setColumns(List<ViewColumn> columns) { |
| 25 | + this.columns = columns; |
| 26 | + } |
| 27 | + |
| 28 | + public List<V> getRows() { |
| 29 | + return rows; |
| 30 | + } |
| 31 | + |
| 32 | + public void setRows(List<V> rows) { |
| 33 | + this.rows = rows; |
| 34 | + } |
| 35 | + |
| 36 | + public String getNextPage() { |
| 37 | + return nextPage; |
| 38 | + } |
| 39 | + |
| 40 | + public void setNextPage(final String nextPage) { |
| 41 | + this.nextPage = nextPage; |
| 42 | + } |
| 43 | + |
| 44 | + public String getPreviousPage() { |
| 45 | + return previousPage; |
| 46 | + } |
| 47 | + |
| 48 | + public void setPreviousPage(final String previousPage) { |
| 49 | + this.previousPage = previousPage; |
| 50 | + } |
| 51 | + |
| 52 | + public int getCount() { |
| 53 | + return count; |
| 54 | + } |
| 55 | + |
| 56 | + public void setCount(final int count) { |
| 57 | + this.count = count; |
| 58 | + } |
| 59 | + |
| 60 | + @Override |
| 61 | + public boolean equals(Object o) { |
| 62 | + if (o == null || getClass() != o.getClass()) return false; |
| 63 | + |
| 64 | + ExecutedViewPage<?> that = (ExecutedViewPage<?>) o; |
| 65 | + return count == that.count |
| 66 | + && Objects.equals(nextPage, that.nextPage) |
| 67 | + && Objects.equals(previousPage, that.previousPage) |
| 68 | + && Objects.equals(columns, that.columns) |
| 69 | + && Objects.equals(rows, that.rows); |
| 70 | + } |
| 71 | + |
| 72 | + @Override |
| 73 | + public int hashCode() { |
| 74 | + int result = Objects.hashCode(nextPage); |
| 75 | + result = 31 * result + Objects.hashCode(previousPage); |
| 76 | + result = 31 * result + count; |
| 77 | + result = 31 * result + Objects.hashCode(columns); |
| 78 | + result = 31 * result + Objects.hashCode(rows); |
| 79 | + return result; |
| 80 | + } |
| 81 | + |
| 82 | + @Override |
| 83 | + public String toString() { |
| 84 | + return "ExecutedViewPage{" |
| 85 | + + "nextPage='" |
| 86 | + + nextPage |
| 87 | + + '\'' |
| 88 | + + ", previousPage='" |
| 89 | + + previousPage |
| 90 | + + '\'' |
| 91 | + + ", count=" |
| 92 | + + count |
| 93 | + + ", columns=" |
| 94 | + + columns |
| 95 | + + ", rows=" |
| 96 | + + rows |
| 97 | + + '}'; |
| 98 | + } |
| 99 | +} |
0 commit comments