1 |
|
package org.europa.together.domain; |
2 |
|
|
3 |
|
import java.util.Date; |
4 |
|
import java.util.HashMap; |
5 |
|
import java.util.Map; |
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (55) |
Complexity: 25 |
Complexity Density: 0.83 |
|
20 |
|
public class JpaPagination { |
21 |
|
|
22 |
|
|
23 |
|
|
24 |
|
|
25 |
|
public static final String ORDER_ASC = "ASC"; |
26 |
|
|
27 |
|
|
28 |
|
|
29 |
|
public static final String ORDER_DESC = "DESC"; |
30 |
|
|
31 |
|
|
32 |
|
|
33 |
|
public static final String PAGING_FOREWARD = "FW"; |
34 |
|
|
35 |
|
|
36 |
|
|
37 |
|
public static final String PAGING_BACKWARD = "BW"; |
38 |
|
|
39 |
|
private String sorting; |
40 |
|
private String paging; |
41 |
|
private int pageSize; |
42 |
|
private String primaryKey; |
43 |
|
private String pageBreak; |
44 |
|
private String additionalOrdering; |
45 |
|
private Map<String, String> filterStringCriteria = new HashMap<>(); |
46 |
|
private Map<String, Boolean> filterBooleanCriteria = new HashMap<>(); |
47 |
|
private Map<String, Integer> filterIntegerCriteria = new HashMap<>(); |
48 |
|
private Map<String, Float> filterFloatCriteria = new HashMap<>(); |
49 |
|
private Map<String, Date> filterDateCriteria = new HashMap<>(); |
50 |
|
|
51 |
|
|
52 |
|
|
53 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
54 |
10 |
public JpaPagination() {... |
55 |
10 |
this.pageSize = 0; |
56 |
10 |
this.sorting = ORDER_ASC; |
57 |
10 |
this.paging = PAGING_FOREWARD; |
58 |
|
} |
59 |
|
|
60 |
|
|
61 |
|
|
62 |
|
|
63 |
|
|
64 |
|
|
65 |
|
@param |
66 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
67 |
47 |
public JpaPagination(final String primaryKey) {... |
68 |
47 |
this.primaryKey = primaryKey; |
69 |
47 |
this.pageSize = 0; |
70 |
47 |
this.sorting = ORDER_ASC; |
71 |
47 |
this.paging = PAGING_FOREWARD; |
72 |
|
} |
73 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
74 |
56 |
@Override... |
75 |
|
public String toString() { |
76 |
56 |
return "JpaPagination{" |
77 |
|
+ "sorting=" + sorting |
78 |
|
+ ", paging=" + paging |
79 |
|
+ ", pageSize=" + pageSize |
80 |
|
+ ", primaryKey=" + primaryKey |
81 |
|
+ ", pageBreak=" + pageBreak |
82 |
|
+ ", additionalOrdering=" + additionalOrdering |
83 |
|
+ ", filterStringCriteria=" + this.filterStringCriteria |
84 |
|
+ ", filterBooleanCriteria=" + this.filterBooleanCriteria |
85 |
|
+ ", filterIntegerCriteria=" + this.filterIntegerCriteria |
86 |
|
+ ", filterFloatCriteria=" + this.filterFloatCriteria |
87 |
|
+ ", filterDateCriteria=" + this.filterDateCriteria |
88 |
|
+ '}'; |
89 |
|
} |
90 |
|
|
91 |
|
|
92 |
|
|
93 |
|
|
94 |
|
|
95 |
|
@return |
96 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
97 |
48 |
public int getPageSize() {... |
98 |
48 |
return pageSize; |
99 |
|
} |
100 |
|
|
101 |
|
|
102 |
|
|
103 |
|
|
104 |
|
@param |
105 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
106 |
15 |
public void setPageSize(final int limit) {... |
107 |
15 |
this.pageSize = limit; |
108 |
|
} |
109 |
|
|
110 |
|
|
111 |
|
|
112 |
|
|
113 |
|
@return |
114 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
115 |
48 |
public String getSorting() {... |
116 |
48 |
return sorting; |
117 |
|
} |
118 |
|
|
119 |
|
|
120 |
|
|
121 |
|
|
122 |
|
@param |
123 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
124 |
5 |
public void setSorting(final String ordering) {... |
125 |
5 |
this.sorting = ordering; |
126 |
|
} |
127 |
|
|
128 |
|
|
129 |
|
|
130 |
|
|
131 |
|
@return |
132 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
133 |
10 |
public String getPaging() {... |
134 |
10 |
return paging; |
135 |
|
} |
136 |
|
|
137 |
|
|
138 |
|
|
139 |
|
|
140 |
|
@param |
141 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
142 |
3 |
public void setPaging(final String direction) {... |
143 |
3 |
this.paging = direction; |
144 |
|
} |
145 |
|
|
146 |
|
|
147 |
|
|
148 |
|
|
149 |
|
@return |
150 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
151 |
57 |
public String getPrimaryKey() {... |
152 |
57 |
return primaryKey; |
153 |
|
} |
154 |
|
|
155 |
|
|
156 |
|
|
157 |
|
|
158 |
|
@param |
159 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
160 |
2 |
public void setPrimaryKey(final String primaryKey) {... |
161 |
2 |
this.primaryKey = primaryKey; |
162 |
|
} |
163 |
|
|
164 |
|
|
165 |
|
|
166 |
|
|
167 |
|
@return |
168 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
169 |
57 |
public String getPageBreak() {... |
170 |
57 |
return pageBreak; |
171 |
|
} |
172 |
|
|
173 |
|
|
174 |
|
|
175 |
|
|
176 |
|
@param |
177 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
178 |
11 |
public void setPageBreak(final String pageBreak) {... |
179 |
11 |
this.pageBreak = pageBreak; |
180 |
|
} |
181 |
|
|
182 |
|
|
183 |
|
|
184 |
|
|
185 |
|
|
186 |
|
@return |
187 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
188 |
53 |
public String getAdditionalOrdering() {... |
189 |
53 |
return additionalOrdering; |
190 |
|
} |
191 |
|
|
192 |
|
|
193 |
|
|
194 |
|
|
195 |
|
|
196 |
|
@param |
197 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
198 |
7 |
public void setAdditionalOrdering(final String additionalOrdering) {... |
199 |
7 |
this.additionalOrdering = additionalOrdering; |
200 |
|
} |
201 |
|
|
202 |
|
|
203 |
|
|
204 |
|
|
205 |
|
|
206 |
|
@return |
207 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
208 |
79 |
public Map<String, String> getFilterStringCriteria() {... |
209 |
79 |
return Map.copyOf(filterStringCriteria); |
210 |
|
} |
211 |
|
|
212 |
|
|
213 |
|
|
214 |
|
|
215 |
|
|
216 |
|
@param |
217 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
218 |
32 |
public void setFilterStringCriteria(final Map<String, String> filterStringCriteria) {... |
219 |
32 |
this.filterStringCriteria.putAll(filterStringCriteria); |
220 |
|
} |
221 |
|
|
222 |
|
|
223 |
|
|
224 |
|
|
225 |
|
|
226 |
|
@return |
227 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
228 |
50 |
public Map<String, Boolean> getFilterBooleanCriteria() {... |
229 |
50 |
return Map.copyOf(filterBooleanCriteria); |
230 |
|
} |
231 |
|
|
232 |
|
|
233 |
|
|
234 |
|
|
235 |
|
|
236 |
|
@param |
237 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
238 |
3 |
public void setFilterBooleanCriteria(final Map<String, Boolean> filterBooleanCriteria) {... |
239 |
3 |
this.filterBooleanCriteria.putAll(filterBooleanCriteria); |
240 |
|
} |
241 |
|
|
242 |
|
|
243 |
|
|
244 |
|
|
245 |
|
|
246 |
|
@return |
247 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
248 |
49 |
public Map<String, Integer> getFilterIntegerCriteria() {... |
249 |
49 |
return Map.copyOf(filterIntegerCriteria); |
250 |
|
} |
251 |
|
|
252 |
|
|
253 |
|
|
254 |
|
|
255 |
|
|
256 |
|
@param |
257 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
258 |
2 |
public void setFilterIntegerCriteria(final Map<String, Integer> filterIntegerCriteria) {... |
259 |
2 |
this.filterIntegerCriteria.putAll(filterIntegerCriteria); |
260 |
|
} |
261 |
|
|
262 |
|
|
263 |
|
|
264 |
|
|
265 |
|
|
266 |
|
@return |
267 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
268 |
50 |
public Map<String, Float> getFilterFloatCriteria() {... |
269 |
50 |
return filterFloatCriteria; |
270 |
|
} |
271 |
|
|
272 |
|
|
273 |
|
|
274 |
|
|
275 |
|
|
276 |
|
@param |
277 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
278 |
4 |
public void setFilterFloatCriteria(final Map<String, Float> filterFloatCriteria) {... |
279 |
4 |
this.filterFloatCriteria = filterFloatCriteria; |
280 |
|
} |
281 |
|
|
282 |
|
|
283 |
|
|
284 |
|
|
285 |
|
|
286 |
|
@return |
287 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
288 |
50 |
public Map<String, Date> getFilterDateCriteria() {... |
289 |
50 |
return filterDateCriteria; |
290 |
|
} |
291 |
|
|
292 |
|
|
293 |
|
|
294 |
|
|
295 |
|
|
296 |
|
@param |
297 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
298 |
4 |
public void setFilterDateCriteria(final Map<String, Date> filterDateCriteria) {... |
299 |
4 |
this.filterDateCriteria = filterDateCriteria; |
300 |
|
} |
301 |
|
|
302 |
|
} |