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