1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
|
22 |
|
|
23 |
|
|
24 |
|
|
25 |
|
|
26 |
|
|
27 |
|
|
28 |
|
|
29 |
|
|
30 |
|
|
31 |
|
|
32 |
|
|
33 |
|
|
34 |
|
package info.magnolia.imaging.parameters; |
35 |
|
|
36 |
|
import info.magnolia.jcr.RuntimeRepositoryException; |
37 |
|
import info.magnolia.jcr.wrapper.DelegateNodeWrapper; |
38 |
|
|
39 |
|
import javax.jcr.Node; |
40 |
|
import javax.jcr.RepositoryException; |
41 |
|
|
42 |
|
|
43 |
|
@link |
44 |
|
|
45 |
|
|
46 |
|
|
|
|
| 84.6% |
Uncovered Elements: 2 (13) |
Complexity: 6 |
Complexity Density: 0.67 |
|
47 |
|
public class SimpleEqualityNodeWrapper extends DelegateNodeWrapper { |
48 |
|
|
49 |
|
private final String identifier; |
50 |
|
|
|
|
| 75% |
Uncovered Elements: 1 (4) |
Complexity: 2 |
Complexity Density: 0.5 |
|
51 |
21 |
public SimpleEqualityNodeWrapper(Node node) {... |
52 |
21 |
super(node); |
53 |
21 |
try { |
54 |
21 |
this.identifier = node.getIdentifier(); |
55 |
|
} catch (RepositoryException e) { |
56 |
0 |
throw new RuntimeRepositoryException(e); |
57 |
|
} |
58 |
|
} |
59 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
60 |
|
@Override... |
61 |
|
public String getIdentifier() { |
62 |
|
return identifier; |
63 |
|
} |
64 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
65 |
7 |
@Override... |
66 |
|
public boolean equals(Object o) { |
67 |
7 |
return isSame((Node) o); |
68 |
|
} |
69 |
|
|
|
|
| 66.7% |
Uncovered Elements: 1 (3) |
Complexity: 2 |
Complexity Density: 0.67 |
|
70 |
7 |
private boolean isSame(Node other) {... |
71 |
7 |
try { |
72 |
7 |
return getIdentifier().equals(other.getIdentifier()); |
73 |
|
} catch (RepositoryException e) { |
74 |
0 |
throw new RuntimeRepositoryException(e); |
75 |
|
} |
76 |
|
} |
77 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
78 |
6 |
@Override... |
79 |
|
public int hashCode() { |
80 |
5 |
return (31 * getIdentifier().hashCode()); |
81 |
|
} |
82 |
|
} |