1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
package org.kuali.student.common.assembly.data; |
17 |
|
|
18 |
|
import java.io.Serializable; |
19 |
|
import java.sql.Time; |
20 |
|
import java.sql.Timestamp; |
21 |
|
import java.util.Date; |
22 |
|
import java.util.HashMap; |
23 |
|
import java.util.HashSet; |
24 |
|
import java.util.Iterator; |
25 |
|
import java.util.LinkedHashMap; |
26 |
|
import java.util.Map; |
27 |
|
import java.util.Set; |
28 |
|
import java.util.Map.Entry; |
29 |
|
|
30 |
|
import javax.xml.bind.annotation.XmlRootElement; |
31 |
|
import javax.xml.bind.annotation.XmlType; |
32 |
|
|
33 |
|
|
34 |
|
|
35 |
|
|
36 |
|
@author |
37 |
|
@see |
38 |
|
|
39 |
|
@SuppressWarnings({"serial", "unchecked"}) |
|
|
| 39.9% |
Uncovered Elements: 212 (353) |
Complexity: 123 |
Complexity Density: 0.6 |
|
40 |
|
public class Data implements Serializable, Iterable<Data.Property>, HasChangeCallbacks { |
41 |
|
@XmlType(name = "lookUpDataType") |
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 0 |
Complexity Density: - |
|
42 |
|
public enum DataType { |
43 |
|
STRING, INTEGER, LONG, FLOAT, DOUBLE, BOOLEAN, DATE, TRUNCATED_DATE, DATA, LIST |
44 |
|
} |
45 |
|
|
46 |
|
@XmlRootElement |
|
|
| 15.4% |
Uncovered Elements: 11 (13) |
Complexity: 6 |
Complexity Density: 1 |
|
47 |
|
public static class BooleanValue implements Value { |
48 |
|
private Boolean value; |
49 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
50 |
0
|
protected BooleanValue() {... |
51 |
|
|
52 |
|
} |
53 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
54 |
7
|
public BooleanValue(final Boolean value) {... |
55 |
7
|
this.value = value; |
56 |
|
} |
57 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
58 |
0
|
@Override... |
59 |
|
public <T> T get() { |
60 |
0
|
return (T) value; |
61 |
|
} |
62 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
63 |
0
|
@Override... |
64 |
|
public Class getType() { |
65 |
0
|
return Boolean.class; |
66 |
|
} |
67 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
68 |
0
|
@Override... |
69 |
|
public String toString() { |
70 |
0
|
if (value == null) { |
71 |
0
|
return ""; |
72 |
|
} else { |
73 |
0
|
return String.valueOf(value); |
74 |
|
} |
75 |
|
} |
76 |
|
} |
77 |
|
|
78 |
|
@XmlRootElement |
|
|
| 46.2% |
Uncovered Elements: 7 (13) |
Complexity: 6 |
Complexity Density: 1 |
|
79 |
|
public static class DataValue implements Value { |
80 |
|
private Data value; |
81 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
82 |
0
|
protected DataValue() {... |
83 |
|
|
84 |
|
} |
85 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
86 |
15
|
public DataValue(final Data value) {... |
87 |
15
|
this.value = value; |
88 |
|
} |
89 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
90 |
67
|
@Override... |
91 |
|
public <T> T get() { |
92 |
67
|
return (T) value; |
93 |
|
} |
94 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
95 |
76
|
@Override... |
96 |
|
public Class getType() { |
97 |
76
|
return Data.class; |
98 |
|
} |
99 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
100 |
0
|
@Override... |
101 |
|
public String toString() { |
102 |
0
|
if (value == null) { |
103 |
0
|
return null; |
104 |
|
} else { |
105 |
0
|
return value.toString(); |
106 |
|
} |
107 |
|
} |
108 |
|
} |
109 |
|
|
110 |
|
@XmlRootElement |
|
|
| 30.8% |
Uncovered Elements: 9 (13) |
Complexity: 6 |
Complexity Density: 1 |
|
111 |
|
public static class DateValue implements Value { |
112 |
|
private Date value; |
113 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
114 |
0
|
protected DateValue() {... |
115 |
|
|
116 |
|
} |
117 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
118 |
1
|
public DateValue(final Date value) {... |
119 |
1
|
this.value = value; |
120 |
|
} |
121 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
122 |
1
|
@Override... |
123 |
|
public <T> T get() { |
124 |
1
|
return (T) value; |
125 |
|
} |
126 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
127 |
0
|
@Override... |
128 |
|
public Class getType() { |
129 |
0
|
return Date.class; |
130 |
|
} |
131 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
132 |
0
|
@Override... |
133 |
|
public String toString() { |
134 |
0
|
if (value == null) { |
135 |
0
|
return null; |
136 |
|
} else { |
137 |
0
|
return String.valueOf(value); |
138 |
|
} |
139 |
|
} |
140 |
|
} |
141 |
|
|
142 |
|
@XmlRootElement |
|
|
| 30.8% |
Uncovered Elements: 9 (13) |
Complexity: 6 |
Complexity Density: 1 |
|
143 |
|
public static class DoubleValue implements Value { |
144 |
|
private Double value; |
145 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
146 |
0
|
protected DoubleValue() {... |
147 |
|
|
148 |
|
} |
149 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
150 |
1
|
public DoubleValue(final Double value) {... |
151 |
1
|
this.value = value; |
152 |
|
} |
153 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
154 |
1
|
@Override... |
155 |
|
public <T> T get() { |
156 |
1
|
return (T) value; |
157 |
|
} |
158 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
159 |
0
|
@Override... |
160 |
|
public Class getType() { |
161 |
0
|
return Double.class; |
162 |
|
} |
163 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
164 |
0
|
@Override... |
165 |
|
public String toString() { |
166 |
0
|
if (value == null) { |
167 |
0
|
return null; |
168 |
|
} else { |
169 |
0
|
return String.valueOf(value); |
170 |
|
} |
171 |
|
} |
172 |
|
} |
173 |
|
|
174 |
|
@XmlRootElement |
|
|
| 0% |
Uncovered Elements: 13 (13) |
Complexity: 6 |
Complexity Density: 1 |
|
175 |
|
public static class FloatValue implements Value { |
176 |
|
private Float value; |
177 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
178 |
0
|
protected FloatValue() {... |
179 |
|
|
180 |
|
} |
181 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
182 |
0
|
public FloatValue(final Float value) {... |
183 |
0
|
this.value = value; |
184 |
|
} |
185 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
186 |
0
|
@Override... |
187 |
|
public <T> T get() { |
188 |
0
|
return (T) value; |
189 |
|
} |
190 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
191 |
0
|
@Override... |
192 |
|
public Class getType() { |
193 |
0
|
return Float.class; |
194 |
|
} |
195 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
196 |
0
|
@Override... |
197 |
|
public String toString() { |
198 |
0
|
if (value == null) { |
199 |
0
|
return null; |
200 |
|
} else { |
201 |
0
|
return String.valueOf(value); |
202 |
|
} |
203 |
|
} |
204 |
|
} |
205 |
|
|
|
|
| 76.9% |
Uncovered Elements: 3 (13) |
Complexity: 7 |
Complexity Density: 1.17 |
|
206 |
|
public static class IntegerKey implements Key { |
207 |
|
private Integer key; |
208 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
209 |
0
|
protected IntegerKey() {... |
210 |
|
|
211 |
|
} |
212 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
213 |
8
|
public IntegerKey(final Integer key) {... |
214 |
8
|
this.key = key; |
215 |
|
} |
216 |
|
|
217 |
|
|
218 |
|
|
219 |
|
|
220 |
|
@see |
221 |
|
|
222 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
223 |
7
|
@Override... |
224 |
|
public boolean equals(final Object obj) { |
225 |
7
|
return obj instanceof IntegerKey && key.equals(((IntegerKey) obj).key); |
226 |
|
} |
227 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
228 |
5
|
@Override... |
229 |
|
public <T> T get() { |
230 |
5
|
return (T) key; |
231 |
|
} |
232 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
233 |
0
|
@Override... |
234 |
|
public Class getType() { |
235 |
0
|
return Integer.class; |
236 |
|
} |
237 |
|
|
238 |
|
|
239 |
|
|
240 |
|
|
241 |
|
@see |
242 |
|
|
243 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
244 |
38
|
@Override... |
245 |
|
public int hashCode() { |
246 |
38
|
return key.hashCode(); |
247 |
|
} |
248 |
|
|
249 |
|
|
250 |
|
|
251 |
|
|
252 |
|
@see |
253 |
|
|
254 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
255 |
14
|
@Override... |
256 |
|
public String toString() { |
257 |
14
|
return String.valueOf(key); |
258 |
|
} |
259 |
|
|
260 |
|
} |
261 |
|
|
262 |
|
@XmlRootElement |
|
|
| 0% |
Uncovered Elements: 13 (13) |
Complexity: 6 |
Complexity Density: 1 |
|
263 |
|
public static class IntegerValue implements Value { |
264 |
|
private Integer value; |
265 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
266 |
0
|
protected IntegerValue() {... |
267 |
|
|
268 |
|
} |
269 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
270 |
0
|
public IntegerValue(final Integer value) {... |
271 |
0
|
this.value = value; |
272 |
|
} |
273 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
274 |
0
|
@Override... |
275 |
|
public <T> T get() { |
276 |
0
|
return (T) value; |
277 |
|
} |
278 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
279 |
0
|
@Override... |
280 |
|
public Class getType() { |
281 |
0
|
return Integer.class; |
282 |
|
} |
283 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
284 |
0
|
@Override... |
285 |
|
public String toString() { |
286 |
0
|
if (value == null) { |
287 |
0
|
return null; |
288 |
|
} else { |
289 |
0
|
return String.valueOf(value); |
290 |
|
} |
291 |
|
} |
292 |
|
} |
293 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 0 |
Complexity Density: - |
|
294 |
|
public interface Key extends Serializable { |
295 |
|
|
296 |
|
<T> T get(); |
297 |
|
|
298 |
|
Class getType(); |
299 |
|
} |
300 |
|
|
301 |
|
@XmlRootElement |
|
|
| 0% |
Uncovered Elements: 13 (13) |
Complexity: 6 |
Complexity Density: 1 |
|
302 |
|
public static class LongValue implements Value { |
303 |
|
private Long value; |
304 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
305 |
0
|
protected LongValue() {... |
306 |
|
|
307 |
|
} |
308 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
309 |
0
|
public LongValue(final Long value) {... |
310 |
0
|
this.value = value; |
311 |
|
} |
312 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
313 |
0
|
@Override... |
314 |
|
public <T> T get() { |
315 |
0
|
return (T) value; |
316 |
|
} |
317 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
318 |
0
|
@Override... |
319 |
|
public Class getType() { |
320 |
0
|
return Long.class; |
321 |
|
} |
322 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
323 |
0
|
@Override... |
324 |
|
public String toString() { |
325 |
0
|
if (value == null) { |
326 |
0
|
return null; |
327 |
|
} else { |
328 |
0
|
return String.valueOf(value); |
329 |
|
} |
330 |
|
} |
331 |
|
} |
332 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 0 |
Complexity Density: - |
|
333 |
|
public interface Property { |
334 |
|
<T> T getKey(); |
335 |
|
|
336 |
|
Class getKeyType(); |
337 |
|
|
338 |
|
Key getWrappedKey(); |
339 |
|
|
340 |
|
<T> T getValue(); |
341 |
|
|
342 |
|
Class getValueType(); |
343 |
|
|
344 |
|
Value getWrappedValue(); |
345 |
|
} |
346 |
|
|
347 |
|
@XmlRootElement |
|
|
| 0% |
Uncovered Elements: 13 (13) |
Complexity: 6 |
Complexity Density: 1 |
|
348 |
|
public static class ShortValue implements Value { |
349 |
|
private Short value; |
350 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
351 |
0
|
protected ShortValue() {... |
352 |
|
|
353 |
|
} |
354 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
355 |
0
|
public ShortValue(final Short value) {... |
356 |
0
|
this.value = value; |
357 |
|
} |
358 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
359 |
0
|
@Override... |
360 |
|
public <T> T get() { |
361 |
0
|
return (T) value; |
362 |
|
} |
363 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
364 |
0
|
@Override... |
365 |
|
public Class getType() { |
366 |
0
|
return Short.class; |
367 |
|
} |
368 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
369 |
0
|
@Override... |
370 |
|
public String toString() { |
371 |
0
|
if (value == null) { |
372 |
0
|
return null; |
373 |
|
} else { |
374 |
0
|
return String.valueOf(value); |
375 |
|
} |
376 |
|
} |
377 |
|
} |
378 |
|
|
379 |
|
@XmlRootElement |
|
|
| 76.9% |
Uncovered Elements: 3 (13) |
Complexity: 7 |
Complexity Density: 1.17 |
|
380 |
|
public static class StringKey implements Key { |
381 |
|
private String key; |
382 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
383 |
0
|
protected StringKey() {... |
384 |
|
|
385 |
|
} |
386 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
387 |
192
|
public StringKey(final String key) {... |
388 |
192
|
this.key = key; |
389 |
|
} |
390 |
|
|
391 |
|
|
392 |
|
|
393 |
|
|
394 |
|
@see |
395 |
|
|
396 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
397 |
115
|
@Override... |
398 |
|
public boolean equals(final Object obj) { |
399 |
115
|
return obj instanceof StringKey && key.equals(((StringKey) obj).key); |
400 |
|
} |
401 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
402 |
239
|
@Override... |
403 |
|
public <T> T get() { |
404 |
239
|
return (T) key; |
405 |
|
} |
406 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
407 |
0
|
@Override... |
408 |
|
public Class<?> getType() { |
409 |
0
|
return String.class; |
410 |
|
} |
411 |
|
|
412 |
|
|
413 |
|
|
414 |
|
|
415 |
|
@see |
416 |
|
|
417 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
418 |
276
|
@Override... |
419 |
|
public int hashCode() { |
420 |
276
|
return key.hashCode(); |
421 |
|
} |
422 |
|
|
423 |
|
|
424 |
|
|
425 |
|
|
426 |
|
@see |
427 |
|
|
428 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
429 |
69
|
@Override... |
430 |
|
public String toString() { |
431 |
69
|
return key; |
432 |
|
} |
433 |
|
|
434 |
|
} |
435 |
|
|
436 |
|
@XmlRootElement |
|
|
| 54.5% |
Uncovered Elements: 5 (11) |
Complexity: 6 |
Complexity Density: 1.2 |
|
437 |
|
public static class StringValue implements Value { |
438 |
|
private String value; |
439 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
440 |
0
|
protected StringValue() {... |
441 |
|
|
442 |
|
} |
443 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
444 |
114
|
public StringValue(final String value) {... |
445 |
114
|
this.value = value; |
446 |
|
} |
447 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
448 |
191
|
@Override... |
449 |
|
public <T> T get() { |
450 |
191
|
return (T) value; |
451 |
|
} |
452 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
453 |
390
|
@Override... |
454 |
|
public Class getType() { |
455 |
390
|
return String.class; |
456 |
|
} |
457 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
458 |
0
|
@Override... |
459 |
|
public String toString() { |
460 |
0
|
return value; |
461 |
|
} |
462 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
463 |
0
|
public void setValue(String value) {... |
464 |
0
|
this.value = value; |
465 |
|
} |
466 |
|
} |
467 |
|
|
468 |
|
@XmlRootElement |
|
|
| 0% |
Uncovered Elements: 13 (13) |
Complexity: 6 |
Complexity Density: 1 |
|
469 |
|
public static class TimestampValue implements Value { |
470 |
|
private Timestamp value; |
471 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
472 |
0
|
protected TimestampValue() {... |
473 |
|
|
474 |
|
} |
475 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
476 |
0
|
public TimestampValue(final Timestamp value) {... |
477 |
0
|
this.value = value; |
478 |
|
} |
479 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
480 |
0
|
@Override... |
481 |
|
public <T> T get() { |
482 |
0
|
return (T) value; |
483 |
|
} |
484 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
485 |
0
|
@Override... |
486 |
|
public Class getType() { |
487 |
0
|
return Timestamp.class; |
488 |
|
} |
489 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
490 |
0
|
@Override... |
491 |
|
public String toString() { |
492 |
0
|
if (value == null) { |
493 |
0
|
return null; |
494 |
|
} else { |
495 |
0
|
return String.valueOf(value); |
496 |
|
} |
497 |
|
} |
498 |
|
} |
499 |
|
|
500 |
|
@XmlRootElement |
|
|
| 0% |
Uncovered Elements: 13 (13) |
Complexity: 6 |
Complexity Density: 1 |
|
501 |
|
public static class TimeValue implements Value { |
502 |
|
private Time value; |
503 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
504 |
0
|
protected TimeValue() {... |
505 |
|
|
506 |
|
} |
507 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
508 |
0
|
public TimeValue(final Time value) {... |
509 |
0
|
this.value = value; |
510 |
|
} |
511 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
512 |
0
|
@Override... |
513 |
|
public <T> T get() { |
514 |
0
|
return (T) value; |
515 |
|
} |
516 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
517 |
0
|
@Override... |
518 |
|
public Class getType() { |
519 |
0
|
return Time.class; |
520 |
|
} |
521 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
522 |
0
|
@Override... |
523 |
|
public String toString() { |
524 |
0
|
if (value == null) { |
525 |
0
|
return null; |
526 |
|
} else { |
527 |
0
|
return String.valueOf(value); |
528 |
|
} |
529 |
|
} |
530 |
|
} |
531 |
|
|
532 |
|
|
533 |
|
|
534 |
|
|
535 |
|
@author |
536 |
|
|
537 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 0 |
Complexity Density: - |
|
538 |
|
public interface Value extends Serializable { |
539 |
|
<T> T get(); |
540 |
|
|
541 |
|
Class getType(); |
542 |
|
} |
543 |
|
|
544 |
|
public static final Key WILDCARD_KEY = new Data.StringKey(QueryPath.getWildCard()); |
545 |
|
|
546 |
|
private transient Set<ChangeCallback> changeCallbacks; |
547 |
|
|
548 |
|
private String className; |
549 |
|
|
550 |
|
private Map<Key, Value> map; |
551 |
|
|
552 |
|
private Data parent = null; |
553 |
|
|
554 |
|
private Key parentKey = null; |
555 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
556 |
22
|
public Data() {... |
557 |
22
|
this(Data.class.getName()); |
558 |
|
} |
559 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
560 |
22
|
public Data(final String className) {... |
561 |
22
|
this.className = className; |
562 |
22
|
map = new LinkedHashMap<Key, Value>(); |
563 |
|
} |
564 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
565 |
139
|
protected void _getQueryPath(final QueryPath path) {... |
566 |
139
|
if (parent != null) { |
567 |
25
|
parent._getQueryPath(path); |
568 |
25
|
path.add(parentKey); |
569 |
|
} |
570 |
|
} |
571 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (9) |
Complexity: 3 |
Complexity Density: 0.6 |
|
572 |
102
|
protected void execChangeCallbacks(ChangeType type, QueryPath path) {... |
573 |
102
|
if (changeCallbacks != null) { |
574 |
10
|
for (ChangeCallback c : changeCallbacks) { |
575 |
10
|
c.onChange(type, path); |
576 |
|
} |
577 |
|
} |
578 |
102
|
if (parent != null) { |
579 |
9
|
parent.execChangeCallbacks(type, path); |
580 |
|
} |
581 |
|
} |
582 |
|
|
|
|
| 83.3% |
Uncovered Elements: 1 (6) |
Complexity: 2 |
Complexity Density: 0.5 |
|
583 |
3
|
public ChangeCallbackRegistration addChangeCallback(final ChangeCallback callback) {... |
584 |
3
|
if (changeCallbacks == null) { |
585 |
3
|
changeCallbacks = new HashSet<ChangeCallback>(); |
586 |
|
} |
587 |
3
|
changeCallbacks.add(callback); |
588 |
3
|
return new ChangeCallbackRegistration() { |
|
|
| 75% |
Uncovered Elements: 1 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
589 |
1
|
@Override... |
590 |
|
public void remove() { |
591 |
1
|
if (changeCallbacks != null) { |
592 |
1
|
changeCallbacks.remove(callback); |
593 |
|
} |
594 |
|
} |
595 |
|
}; |
596 |
|
} |
597 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (7) |
Complexity: 2 |
Complexity Density: 0.4 |
|
598 |
93
|
private void put(Key key, Value value) {... |
599 |
93
|
Value existing = map.put(key, value); |
600 |
93
|
ChangeType type = existing == null ? ChangeType.ADD : ChangeType.UPDATE; |
601 |
93
|
QueryPath path = getQueryPath(); |
602 |
93
|
path.add(key); |
603 |
93
|
execChangeCallbacks(type, path); |
604 |
|
} |
605 |
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
606 |
0
|
public void remove(Key key) {... |
607 |
|
|
608 |
0
|
map.remove(key); |
609 |
0
|
QueryPath path = getQueryPath(); |
610 |
0
|
path.add(key); |
611 |
0
|
execChangeCallbacks(ChangeType.REMOVE, path); |
612 |
|
} |
613 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
614 |
0
|
public void add(final Boolean value) {... |
615 |
0
|
put(new IntegerKey(map.size()), new BooleanValue(value)); |
616 |
|
} |
617 |
|
|
|
|
| 85.7% |
Uncovered Elements: 1 (7) |
Complexity: 2 |
Complexity Density: 0.4 |
|
618 |
1
|
public void add(final Data value) {... |
619 |
1
|
final Key k = new IntegerKey(map.size()); |
620 |
1
|
put(k, new DataValue(value)); |
621 |
1
|
if (value != null) { |
622 |
1
|
value.parent = this; |
623 |
1
|
value.parentKey = k; |
624 |
|
} |
625 |
|
} |
626 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
627 |
0
|
public void add(final Date value) {... |
628 |
0
|
put(new IntegerKey(map.size()), new DateValue(value)); |
629 |
|
} |
630 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
631 |
0
|
public void add(final Double value) {... |
632 |
0
|
put(new IntegerKey(map.size()), new DoubleValue(value)); |
633 |
|
} |
634 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
635 |
0
|
public void add(final Float value) {... |
636 |
0
|
put(new IntegerKey(map.size()), new FloatValue(value)); |
637 |
|
} |
638 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
639 |
0
|
public void add(final Integer value) {... |
640 |
0
|
put(new IntegerKey(map.size()), new IntegerValue(value)); |
641 |
|
} |
642 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
643 |
0
|
public void add(final Long value) {... |
644 |
0
|
put(new IntegerKey(map.size()), new LongValue(value)); |
645 |
|
} |
646 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
647 |
0
|
public void add(final Short value) {... |
648 |
0
|
put(new IntegerKey(map.size()), new ShortValue(value)); |
649 |
|
} |
650 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
651 |
0
|
public void add(final String value) {... |
652 |
0
|
put(new IntegerKey(map.size()), new StringValue(value)); |
653 |
|
} |
654 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
655 |
0
|
public void add(final Time value) {... |
656 |
0
|
put(new IntegerKey(map.size()), new TimeValue(value)); |
657 |
|
} |
658 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
659 |
0
|
public void add(final Timestamp value) {... |
660 |
0
|
put(new IntegerKey(map.size()), new TimestampValue(value)); |
661 |
|
} |
662 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
663 |
0
|
public Data copy() {... |
664 |
0
|
return copy(new Data(this.className), true); |
665 |
|
} |
666 |
|
|
|
|
| 0% |
Uncovered Elements: 12 (12) |
Complexity: 4 |
Complexity Density: 0.5 |
|
667 |
0
|
public Data copy(Data target, boolean recurse) {... |
668 |
|
|
669 |
|
|
670 |
0
|
for (final Entry<Key, Value> e : map.entrySet()) { |
671 |
0
|
if (recurse && e.getValue().getType().equals(Data.class)) { |
672 |
0
|
Data value = e.getValue().get(); |
673 |
0
|
if (value != null) { |
674 |
0
|
value = value.copy(); |
675 |
|
} |
676 |
0
|
target.map.put(e.getKey(), new DataValue(value)); |
677 |
|
} else { |
678 |
0
|
target.map.put(e.getKey(), e.getValue()); |
679 |
|
} |
680 |
|
} |
681 |
0
|
return target; |
682 |
|
} |
683 |
|
|
|
|
| 0% |
Uncovered Elements: 7 (7) |
Complexity: 2 |
Complexity Density: 0.4 |
|
684 |
0
|
public <T> T get(final Integer key) {... |
685 |
0
|
final Value v = map.get(new IntegerKey(key)); |
686 |
0
|
T result = null; |
687 |
0
|
if (v != null) { |
688 |
0
|
result = (T) v.get(); |
689 |
|
} |
690 |
0
|
return result; |
691 |
|
} |
692 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (7) |
Complexity: 2 |
Complexity Density: 0.4 |
|
693 |
112
|
public <T> T get(final Key key) {... |
694 |
112
|
final Value v = map.get(key); |
695 |
112
|
T result = null; |
696 |
112
|
if (v != null) { |
697 |
83
|
result = (T) v.get(); |
698 |
|
} |
699 |
112
|
return result; |
700 |
|
} |
701 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (7) |
Complexity: 2 |
Complexity Density: 0.4 |
|
702 |
12
|
public <T> T get(final String key) {... |
703 |
12
|
final Value v = map.get(new StringKey(key)); |
704 |
12
|
T result = null; |
705 |
12
|
if (v != null) { |
706 |
8
|
result = (T) v.get(); |
707 |
|
} |
708 |
12
|
return result; |
709 |
|
} |
710 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
711 |
0
|
public String getClassName() {... |
712 |
0
|
return this.className; |
713 |
|
} |
714 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
715 |
0
|
public Data getParent() {... |
716 |
0
|
return parent; |
717 |
|
} |
718 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
719 |
114
|
public QueryPath getQueryPath() {... |
720 |
114
|
final QueryPath result = new QueryPath(); |
721 |
114
|
_getQueryPath(result); |
722 |
114
|
return result; |
723 |
|
} |
724 |
|
|
725 |
|
|
726 |
|
|
727 |
|
@return |
728 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
729 |
1
|
public Iterator<Property> realPropertyIterator() {... |
730 |
1
|
HashMap<Key, Value> propertyMap = new HashMap<Key, Value>(map); |
731 |
|
|
732 |
1
|
propertyMap.remove(new StringKey("_runtimeData")); |
733 |
|
|
734 |
1
|
final Iterator<Map.Entry<Key, Value>> impl = propertyMap.entrySet().iterator(); |
735 |
|
|
736 |
1
|
return new Iterator<Property>() { |
737 |
|
Map.Entry<Key, Value> current; |
738 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
739 |
2
|
@Override... |
740 |
|
public boolean hasNext() { |
741 |
2
|
return impl.hasNext(); |
742 |
|
} |
743 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
744 |
1
|
@Override... |
745 |
|
public Property next() { |
746 |
1
|
final Map.Entry<Key, Value> entry = impl.next(); |
747 |
1
|
current = entry; |
748 |
1
|
return new Property() { |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
749 |
0
|
@Override... |
750 |
|
public <T> T getKey() { |
751 |
0
|
return (T) entry.getKey().get(); |
752 |
|
} |
753 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
754 |
0
|
@Override... |
755 |
|
public Class<?> getKeyType() { |
756 |
0
|
return entry.getKey().getType(); |
757 |
|
} |
758 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
759 |
1
|
@Override... |
760 |
|
public <T> T getValue() { |
761 |
1
|
return (T) entry.getValue().get(); |
762 |
|
} |
763 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
764 |
0
|
@Override... |
765 |
|
public Class<?> getValueType() { |
766 |
0
|
return entry.getValue().getType(); |
767 |
|
} |
768 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
769 |
0
|
@Override... |
770 |
|
public Key getWrappedKey() { |
771 |
0
|
return entry.getKey(); |
772 |
|
} |
773 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
774 |
0
|
@Override... |
775 |
|
public Value getWrappedValue() { |
776 |
0
|
return entry.getValue(); |
777 |
|
} |
778 |
|
}; |
779 |
|
} |
780 |
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
781 |
0
|
@Override... |
782 |
|
public void remove() { |
783 |
0
|
impl.remove(); |
784 |
0
|
QueryPath path = getQueryPath(); |
785 |
0
|
path.add(current.getKey()); |
786 |
0
|
execChangeCallbacks(ChangeType.REMOVE, path); |
787 |
|
} |
788 |
|
}; |
789 |
|
} |
790 |
|
|
791 |
|
|
792 |
|
|
793 |
|
|
794 |
|
@see |
795 |
|
|
796 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
797 |
16
|
@Override... |
798 |
|
public Iterator<Property> iterator() { |
799 |
16
|
final Iterator<Map.Entry<Key, Value>> impl = map.entrySet().iterator(); |
800 |
|
|
801 |
16
|
return new Iterator<Property>() { |
802 |
|
Map.Entry<Key, Value> current; |
803 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
804 |
8
|
@Override... |
805 |
|
public boolean hasNext() { |
806 |
8
|
return impl.hasNext(); |
807 |
|
} |
808 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
809 |
70
|
@Override... |
810 |
|
public Property next() { |
811 |
70
|
final Map.Entry<Key, Value> entry = impl.next(); |
812 |
64
|
current = entry; |
813 |
64
|
return new Property() { |
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
814 |
237
|
@Override... |
815 |
|
public <T> T getKey() { |
816 |
237
|
return (T) entry.getKey().get(); |
817 |
|
} |
818 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
819 |
0
|
@Override... |
820 |
|
public Class<?> getKeyType() { |
821 |
0
|
return entry.getKey().getType(); |
822 |
|
} |
823 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
824 |
163
|
@Override... |
825 |
|
public <T> T getValue() { |
826 |
163
|
return (T) entry.getValue().get(); |
827 |
|
} |
828 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
829 |
466
|
@Override... |
830 |
|
public Class<?> getValueType() { |
831 |
466
|
return entry.getValue().getType(); |
832 |
|
} |
833 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
834 |
0
|
@Override... |
835 |
|
public Key getWrappedKey() { |
836 |
0
|
return entry.getKey(); |
837 |
|
} |
838 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
839 |
0
|
@Override... |
840 |
|
public Value getWrappedValue() { |
841 |
0
|
return entry.getValue(); |
842 |
|
} |
843 |
|
}; |
844 |
|
} |
845 |
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
846 |
0
|
@Override... |
847 |
|
public void remove() { |
848 |
0
|
impl.remove(); |
849 |
0
|
QueryPath path = getQueryPath(); |
850 |
0
|
path.add(current.getKey()); |
851 |
0
|
execChangeCallbacks(ChangeType.REMOVE, path); |
852 |
|
} |
853 |
|
}; |
854 |
|
} |
855 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (17) |
Complexity: 6 |
Complexity Density: 0.55 |
|
856 |
16
|
public <T> T query(final QueryPath path) {... |
857 |
16
|
T result = null; |
858 |
16
|
Data d = this; |
859 |
37
|
for (final Iterator itr = path.iterator(); itr.hasNext() && d != null;) { |
860 |
26
|
final Key k = (Key) itr.next(); |
861 |
26
|
if (itr.hasNext()) { |
862 |
23
|
Object obj = d.get(k); |
863 |
23
|
if (obj != null && !(obj instanceof Data)) { |
864 |
|
|
865 |
|
|
866 |
|
|
867 |
5
|
throw new java.lang.IllegalArgumentException(); |
868 |
|
} else { |
869 |
18
|
d = d.get(k); |
870 |
|
} |
871 |
|
} else { |
872 |
3
|
result = (T) d.get(k); |
873 |
|
} |
874 |
|
} |
875 |
11
|
return result; |
876 |
|
} |
877 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
878 |
2
|
public <T> T query(final String path) {... |
879 |
2
|
return (T) query(QueryPath.parse(path)); |
880 |
|
} |
881 |
|
|
|
|
| 0% |
Uncovered Elements: 12 (12) |
Complexity: 3 |
Complexity Density: 0.38 |
|
882 |
0
|
public Class<?> getType(final QueryPath path) {... |
883 |
0
|
Value result = null; |
884 |
0
|
Data d = this; |
885 |
0
|
for (final Iterator itr = path.iterator(); itr.hasNext();) { |
886 |
0
|
final Key k = (Key) itr.next(); |
887 |
0
|
if (itr.hasNext()) { |
888 |
0
|
d = d.get(k); |
889 |
|
} else { |
890 |
0
|
result = map.get(k); |
891 |
|
} |
892 |
|
} |
893 |
0
|
return result.getType(); |
894 |
|
|
895 |
|
} |
896 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
897 |
0
|
public void set(final Integer key, final Boolean value) {... |
898 |
0
|
put(new IntegerKey(key), new BooleanValue(value)); |
899 |
|
} |
900 |
|
|
|
|
| 0% |
Uncovered Elements: 7 (7) |
Complexity: 2 |
Complexity Density: 0.4 |
|
901 |
0
|
public void set(final Integer key, final Data value) {... |
902 |
0
|
final Key k = new IntegerKey(key); |
903 |
0
|
put(k, new DataValue(value)); |
904 |
0
|
if (value != null) { |
905 |
0
|
value.parent = this; |
906 |
0
|
value.parentKey = k; |
907 |
|
} |
908 |
|
} |
909 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
910 |
0
|
public void set(final Integer key, final Date value) {... |
911 |
0
|
put(new IntegerKey(key), new DateValue(value)); |
912 |
|
} |
913 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
914 |
0
|
public void set(final Integer key, final Double value) {... |
915 |
0
|
put(new IntegerKey(key), new DoubleValue(value)); |
916 |
|
} |
917 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
918 |
0
|
public void set(final Integer key, final Float value) {... |
919 |
0
|
put(new IntegerKey(key), new FloatValue(value)); |
920 |
|
} |
921 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
922 |
0
|
public void set(final Integer key, final Integer value) {... |
923 |
0
|
put(new IntegerKey(key), new IntegerValue(value)); |
924 |
|
} |
925 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
926 |
0
|
public void set(final Integer key, final Long value) {... |
927 |
0
|
put(new IntegerKey(key), new LongValue(value)); |
928 |
|
} |
929 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
930 |
0
|
public void set(final Integer key, final Short value) {... |
931 |
0
|
put(new IntegerKey(key), new ShortValue(value)); |
932 |
|
} |
933 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
934 |
0
|
public void set(final Integer key, final String value) {... |
935 |
0
|
put(new IntegerKey(key), new StringValue(value)); |
936 |
|
} |
937 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
938 |
0
|
public void set(final Integer key, final Time value) {... |
939 |
0
|
put(new IntegerKey(key), new TimeValue(value)); |
940 |
|
} |
941 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
942 |
0
|
public void set(final Integer key, final Timestamp value) {... |
943 |
0
|
put(new IntegerKey(key), new TimestampValue(value)); |
944 |
|
} |
945 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
946 |
0
|
public void set(final Key key, final Boolean value) {... |
947 |
0
|
put(key, new BooleanValue(value)); |
948 |
|
} |
949 |
|
|
|
|
| 0% |
Uncovered Elements: 6 (6) |
Complexity: 2 |
Complexity Density: 0.5 |
|
950 |
0
|
public void set(final Key key, final Data value) {... |
951 |
0
|
put(key, new DataValue(value)); |
952 |
0
|
if (value != null) { |
953 |
0
|
value.parent = this; |
954 |
0
|
value.parentKey = key; |
955 |
|
} |
956 |
|
} |
957 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
958 |
0
|
public void set(final Key key, final Date value) {... |
959 |
0
|
put(key, new DateValue(value)); |
960 |
|
} |
961 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
962 |
0
|
public void set(final Key key, final Double value) {... |
963 |
0
|
put(key, new DoubleValue(value)); |
964 |
|
} |
965 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
966 |
0
|
public void set(final Key key, final Float value) {... |
967 |
0
|
put(key, new FloatValue(value)); |
968 |
|
} |
969 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
970 |
0
|
public void set(final Key key, final Integer value) {... |
971 |
0
|
put(key, new IntegerValue(value)); |
972 |
|
} |
973 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
974 |
0
|
public void set(final Key key, final Long value) {... |
975 |
0
|
put(key, new LongValue(value)); |
976 |
|
} |
977 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
978 |
0
|
public void set(final Key key, final Short value) {... |
979 |
0
|
put(key, new ShortValue(value)); |
980 |
|
} |
981 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
982 |
0
|
public void set(final Key key, final String value) {... |
983 |
0
|
put(key, new StringValue(value)); |
984 |
|
} |
985 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
986 |
0
|
public void set(final Key key, final Time value) {... |
987 |
0
|
put(key, new TimeValue(value)); |
988 |
|
} |
989 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
990 |
0
|
public void set(final Key key, final Timestamp value) {... |
991 |
0
|
put(key, new TimestampValue(value)); |
992 |
|
} |
993 |
|
|
|
|
| 90% |
Uncovered Elements: 1 (10) |
Complexity: 3 |
Complexity Density: 0.5 |
|
994 |
10
|
public void set(final Key key, final Value value) {... |
995 |
10
|
put(key, value); |
996 |
10
|
if (value instanceof DataValue) { |
997 |
5
|
final Data d = value.get(); |
998 |
5
|
if (d != null) { |
999 |
5
|
d.parent = this; |
1000 |
5
|
d.parentKey = key; |
1001 |
|
} |
1002 |
|
} |
1003 |
|
} |
1004 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1005 |
0
|
public void set(final String key, final Boolean value) {... |
1006 |
0
|
put(new StringKey(key), new BooleanValue(value)); |
1007 |
|
} |
1008 |
|
|
|
|
| 85.7% |
Uncovered Elements: 1 (7) |
Complexity: 2 |
Complexity Density: 0.4 |
|
1009 |
9
|
public void set(final String key, final Data value) {... |
1010 |
9
|
final Key k = new StringKey(key); |
1011 |
9
|
put(k, new DataValue(value)); |
1012 |
9
|
if (value != null) { |
1013 |
9
|
value.parent = this; |
1014 |
9
|
value.parentKey = k; |
1015 |
|
} |
1016 |
|
} |
1017 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1018 |
1
|
public void set(final String key, final Date value) {... |
1019 |
1
|
put(new StringKey(key), new DateValue(value)); |
1020 |
|
} |
1021 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1022 |
1
|
public void set(final String key, final Double value) {... |
1023 |
1
|
put(new StringKey(key), new DoubleValue(value)); |
1024 |
|
} |
1025 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1026 |
0
|
public void set(final String key, final Float value) {... |
1027 |
0
|
put(new StringKey(key), new FloatValue(value)); |
1028 |
|
} |
1029 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1030 |
0
|
public void set(final String key, final Integer value) {... |
1031 |
0
|
put(new StringKey(key), new IntegerValue(value)); |
1032 |
|
} |
1033 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1034 |
0
|
public void set(final String key, final Long value) {... |
1035 |
0
|
put(new StringKey(key), new LongValue(value)); |
1036 |
|
} |
1037 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1038 |
0
|
public void set(final String key, final Short value) {... |
1039 |
0
|
put(new StringKey(key), new ShortValue(value)); |
1040 |
|
} |
1041 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1042 |
71
|
public void set(final String key, final String value) {... |
1043 |
71
|
put(new StringKey(key), new StringValue(value)); |
1044 |
|
} |
1045 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1046 |
0
|
public void set(final String key, final Time value) {... |
1047 |
0
|
put(new StringKey(key), new TimeValue(value)); |
1048 |
|
} |
1049 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1050 |
0
|
public void set(final String key, final Timestamp value) {... |
1051 |
0
|
put(new StringKey(key), new TimestampValue(value)); |
1052 |
|
} |
1053 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1054 |
0
|
public Integer size() {... |
1055 |
0
|
return map.size(); |
1056 |
|
} |
1057 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1058 |
0
|
public String toString() {... |
1059 |
0
|
return _toXmlString(""); |
1060 |
|
} |
1061 |
|
|
1062 |
|
|
1063 |
|
|
1064 |
|
@return |
1065 |
|
|
|
|
| 0% |
Uncovered Elements: 13 (13) |
Complexity: 3 |
Complexity Density: 0.33 |
|
1066 |
0
|
private String _toString(){... |
1067 |
0
|
StringBuffer dataString = new StringBuffer(); |
1068 |
|
|
1069 |
0
|
dataString.append("{"); |
1070 |
0
|
for (Iterator itr = this.iterator(); itr.hasNext();) { |
1071 |
0
|
Property p = (Property) itr.next(); |
1072 |
0
|
dataString.append(p.getKey() + "=" + p.getValue()); |
1073 |
0
|
if (itr.hasNext()) { |
1074 |
0
|
dataString.append(", "); |
1075 |
|
} |
1076 |
|
} |
1077 |
0
|
dataString.append("}"); |
1078 |
|
|
1079 |
0
|
return dataString.toString(); |
1080 |
|
} |
1081 |
|
|
1082 |
|
|
1083 |
|
|
1084 |
|
|
1085 |
|
|
|
|
| 0% |
Uncovered Elements: 24 (24) |
Complexity: 5 |
Complexity Density: 0.31 |
|
1086 |
0
|
private String _toXmlString(String indent){... |
1087 |
0
|
StringBuffer dataString = new StringBuffer(); |
1088 |
|
|
1089 |
0
|
for (Iterator itr = this.iterator(); itr.hasNext();) { |
1090 |
0
|
Property p = (Property) itr.next(); |
1091 |
0
|
Object value = p.getValue(); |
1092 |
0
|
if (value instanceof Data){ |
1093 |
0
|
if (p.getKey() instanceof Integer){ |
1094 |
0
|
dataString.append(indent + "<listitem index=\"" + p.getKey() + "\">\n"); |
1095 |
0
|
dataString.append(((Data)value)._toXmlString(indent + " ")); |
1096 |
0
|
dataString.append(indent + "</listitem>\n"); |
1097 |
|
} else { |
1098 |
0
|
dataString.append(indent + "<" + p.getKey() + ">\n"); |
1099 |
0
|
dataString.append(((Data)value)._toXmlString(indent + " ")); |
1100 |
0
|
dataString.append(indent + "</" + p.getKey() + ">\n"); |
1101 |
|
} |
1102 |
0
|
} else if (p.getKey() instanceof Integer){ |
1103 |
0
|
dataString.append(indent + "<listitem index=\"" + p.getKey() + "\" value=\""+ value + "\"/>\n"); |
1104 |
|
} else { |
1105 |
0
|
dataString.append(indent + "<" + p.getKey() + " value=\""+ value + "\"/>\n"); |
1106 |
|
} |
1107 |
|
} |
1108 |
|
|
1109 |
0
|
return dataString.toString(); |
1110 |
|
} |
1111 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1112 |
6
|
public boolean containsKey(Key key) {... |
1113 |
6
|
return map.containsKey(key); |
1114 |
|
} |
1115 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1116 |
0
|
public boolean containsValue(Value value) {... |
1117 |
0
|
return map.containsValue(value); |
1118 |
|
} |
1119 |
|
|
1120 |
|
|
1121 |
|
@return |
1122 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1123 |
6
|
public Set keySet() {... |
1124 |
6
|
return map.keySet(); |
1125 |
|
} |
1126 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
1127 |
0
|
public boolean isEmpty() {... |
1128 |
0
|
return map.isEmpty(); |
1129 |
|
} |
1130 |
|
} |