1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.syncope.common.lib.to;
20
21 import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
22 import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
23 import java.net.URI;
24 import java.util.ArrayList;
25 import java.util.List;
26 import org.apache.commons.lang3.builder.EqualsBuilder;
27 import org.apache.commons.lang3.builder.HashCodeBuilder;
28 import org.apache.syncope.common.lib.BaseBean;
29
30 public class PagedConnObjectResult implements BaseBean {
31
32 private static final long serialVersionUID = -2832908019064402976L;
33
34 private URI next;
35
36 private final List<ConnObject> result = new ArrayList<>();
37
38 private String pagedResultsCookie;
39
40 private int remainingPagedResults = -1;
41
42 private boolean allResultsReturned = true;
43
44 public URI getNext() {
45 return next;
46 }
47
48 public void setNext(final URI next) {
49 this.next = next;
50 }
51
52
53
54
55
56
57
58 public String getPagedResultsCookie() {
59 return pagedResultsCookie;
60 }
61
62
63
64
65
66 public void setPagedResultsCookie(final String pagedResultsCookie) {
67 this.pagedResultsCookie = pagedResultsCookie;
68 }
69
70
71
72
73
74
75
76
77
78 public int getRemainingPagedResults() {
79 return remainingPagedResults;
80 }
81
82
83
84
85
86
87 public void setRemainingPagedResults(final int remainingPagedResults) {
88 this.remainingPagedResults = remainingPagedResults;
89 }
90
91
92
93
94
95
96
97 public boolean isAllResultsReturned() {
98 return allResultsReturned;
99 }
100
101
102
103
104
105
106 public void setAllResultsReturned(final boolean allResultsReturned) {
107 this.allResultsReturned = allResultsReturned;
108 }
109
110 @JacksonXmlElementWrapper(localName = "result")
111 @JacksonXmlProperty(localName = "item")
112 public List<ConnObject> getResult() {
113 return result;
114 }
115
116 @Override
117 public int hashCode() {
118 return new HashCodeBuilder().
119 append(next).
120 append(result).
121 append(pagedResultsCookie).
122 append(remainingPagedResults).
123 append(allResultsReturned).
124 build();
125 }
126
127 @Override
128 public boolean equals(final Object obj) {
129 if (this == obj) {
130 return true;
131 }
132 if (obj == null) {
133 return false;
134 }
135 if (getClass() != obj.getClass()) {
136 return false;
137 }
138 final PagedConnObjectResult other = (PagedConnObjectResult) obj;
139 return new EqualsBuilder().
140 append(next, other.next).
141 append(result, other.result).
142 append(pagedResultsCookie, other.pagedResultsCookie).
143 append(remainingPagedResults, other.remainingPagedResults).
144 append(allResultsReturned, other.allResultsReturned).
145 build();
146 }
147 }