1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package org.xwiki.bridge.event; |
21 |
|
|
22 |
|
import java.io.Serializable; |
23 |
|
|
24 |
|
import org.apache.commons.lang3.StringUtils; |
25 |
|
|
26 |
|
|
27 |
|
|
28 |
|
|
29 |
|
@version |
30 |
|
@since |
31 |
|
|
32 |
|
|
|
|
| 93.5% |
Uncovered Elements: 2 (31) |
Complexity: 12 |
Complexity Density: 0.75 |
|
33 |
|
public abstract class AbstractActionExecutionEvent implements Serializable, ActionExecutionEvent |
34 |
|
{ |
35 |
|
|
36 |
|
|
37 |
|
|
38 |
|
|
39 |
|
private static final long serialVersionUID = 1L; |
40 |
|
|
41 |
|
|
42 |
|
|
43 |
|
|
44 |
|
private String actionName; |
45 |
|
|
46 |
|
|
47 |
|
@link |
48 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
49 |
125 |
public AbstractActionExecutionEvent()... |
50 |
|
{ |
51 |
|
|
52 |
|
} |
53 |
|
|
54 |
|
|
55 |
|
|
56 |
|
|
57 |
|
@param |
58 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
59 |
19268 |
public AbstractActionExecutionEvent(String actionName)... |
60 |
|
{ |
61 |
19263 |
this.actionName = actionName; |
62 |
|
} |
63 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
64 |
131447 |
@Override... |
65 |
|
public String getActionName() |
66 |
|
{ |
67 |
131447 |
return this.actionName; |
68 |
|
} |
69 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
70 |
6 |
@Override... |
71 |
|
public int hashCode() |
72 |
|
{ |
73 |
6 |
if (getActionName() == null) { |
74 |
2 |
return 0; |
75 |
|
} |
76 |
4 |
return getActionName().hashCode(); |
77 |
|
} |
78 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 3 |
Complexity Density: 1 |
|
79 |
24 |
@Override... |
80 |
|
public boolean equals(Object object) |
81 |
|
{ |
82 |
24 |
if (object != null && getClass().isAssignableFrom(object.getClass())) { |
83 |
18 |
return StringUtils.equals(getActionName(), ((ActionExecutionEvent) object).getActionName()); |
84 |
|
} |
85 |
6 |
return false; |
86 |
|
} |
87 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (11) |
Complexity: 3 |
Complexity Density: 0.43 |
|
88 |
46677 |
@Override... |
89 |
|
public boolean matches(Object otherEvent) |
90 |
|
{ |
91 |
46668 |
if (otherEvent == null) { |
92 |
4 |
return false; |
93 |
|
} |
94 |
46665 |
boolean isMatching = false; |
95 |
46702 |
if (getClass().isAssignableFrom(otherEvent.getClass())) { |
96 |
46690 |
ActionExecutionEvent actionEvent = (ActionExecutionEvent) otherEvent; |
97 |
46700 |
isMatching = getActionName() == null || getActionName().equals(actionEvent.getActionName()); |
98 |
|
} |
99 |
46695 |
return isMatching; |
100 |
|
} |
101 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
102 |
0 |
@Override... |
103 |
|
public String toString() |
104 |
|
{ |
105 |
0 |
return getClass() + " (" + getActionName() + ")"; |
106 |
|
} |
107 |
|
} |