1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package com.atlassian.jira.rest.client.domain;
18
19 import com.google.common.base.Objects;
20
21
22
23
24
25
26
27 public class SearchResult {
28 private final int startIndex;
29 private final int maxResults;
30 private final int total;
31 private final Iterable<BasicIssue> issues;
32
33 public SearchResult(int startIndex, int maxResults, int total, Iterable<BasicIssue> issues) {
34 this.startIndex = startIndex;
35 this.maxResults = maxResults;
36 this.total = total;
37 this.issues = issues;
38 }
39
40
41
42
43
44
45 public int getStartIndex() {
46 return startIndex;
47 }
48
49
50
51
52 public int getMaxResults() {
53 return maxResults;
54 }
55
56
57
58
59
60 public int getTotal() {
61 return total;
62 }
63
64 public Iterable<BasicIssue> getIssues() {
65 return issues;
66 }
67
68 @Override
69 public String toString() {
70 return Objects.toStringHelper(this).
71 add("startIndex", startIndex).
72 add("maxResults", maxResults).
73 add("total", total).
74 add("issues", issues).
75 toString();
76 }
77
78 @Override
79 public boolean equals(Object obj) {
80 if (obj instanceof SearchResult) {
81 SearchResult that = (SearchResult) obj;
82 return Objects.equal(this.startIndex, that.startIndex)
83 && Objects.equal(this.maxResults, that.maxResults)
84 && Objects.equal(this.total, that.total)
85 && Objects.equal(this.issues, that.issues);
86 }
87 return false;
88 }
89
90 @Override
91 public int hashCode() {
92 return Objects.hashCode(startIndex, maxResults, total, issues);
93 }
94
95 }