1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package org.xwiki.watchlist.internal.notification; |
21 |
|
|
22 |
|
import java.util.List; |
23 |
|
import java.util.Map; |
24 |
|
|
25 |
|
import org.apache.commons.collections4.ListUtils; |
26 |
|
import org.apache.commons.lang3.builder.ToStringBuilder; |
27 |
|
import org.xwiki.model.reference.DocumentReference; |
28 |
|
import org.xwiki.text.XWikiToStringBuilder; |
29 |
|
import org.xwiki.watchlist.internal.api.WatchListEvent; |
30 |
|
|
31 |
|
|
32 |
|
@link |
33 |
|
|
34 |
|
|
35 |
|
@version |
36 |
|
@since |
37 |
|
|
|
|
| 68.8% |
Uncovered Elements: 5 (16) |
Complexity: 5 |
Complexity Density: 0.45 |
|
38 |
|
public class EventsAndSubscribersSource |
39 |
|
{ |
40 |
|
|
41 |
|
|
42 |
|
|
43 |
|
public static final String SUBSCRIBERS_PARAMETER = "subscribers"; |
44 |
|
|
45 |
|
|
46 |
|
|
47 |
|
|
48 |
|
public static final String EVENTS_PARAMETER = "events"; |
49 |
|
|
50 |
|
private List<WatchListEvent> events; |
51 |
|
|
52 |
|
private List<DocumentReference> subscribers; |
53 |
|
|
54 |
|
|
55 |
|
@param@link |
56 |
|
@param@link |
57 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
58 |
71 |
public EventsAndSubscribersSource(List<WatchListEvent> events, List<DocumentReference> subscribers)... |
59 |
|
{ |
60 |
71 |
this.events = events; |
61 |
71 |
this.subscribers = subscribers; |
62 |
|
} |
63 |
|
|
64 |
|
|
65 |
|
@return |
66 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
67 |
35 |
public List<WatchListEvent> getEvents()... |
68 |
|
{ |
69 |
35 |
return events; |
70 |
|
} |
71 |
|
|
72 |
|
|
73 |
|
@return |
74 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
75 |
30 |
public List<DocumentReference> getSubscribers()... |
76 |
|
{ |
77 |
30 |
return subscribers; |
78 |
|
} |
79 |
|
|
80 |
|
|
81 |
|
@param |
82 |
|
|
83 |
|
@return |
84 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
85 |
60 |
public static EventsAndSubscribersSource parse(Map<String, Object> sourceMap)... |
86 |
|
{ |
87 |
60 |
List<WatchListEvent> events = ListUtils.emptyIfNull((List<WatchListEvent>) sourceMap.get(EVENTS_PARAMETER)); |
88 |
60 |
List<DocumentReference> subscribers = |
89 |
|
ListUtils.emptyIfNull((List<DocumentReference>) sourceMap.get(SUBSCRIBERS_PARAMETER)); |
90 |
|
|
91 |
60 |
return new EventsAndSubscribersSource(events, subscribers); |
92 |
|
} |
93 |
|
|
|
|
| 0% |
Uncovered Elements: 4 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
94 |
0 |
@Override... |
95 |
|
public String toString() |
96 |
|
{ |
97 |
0 |
ToStringBuilder builder = new XWikiToStringBuilder(this); |
98 |
0 |
builder.append(EVENTS_PARAMETER, getEvents()); |
99 |
0 |
builder.append(SUBSCRIBERS_PARAMETER, getSubscribers()); |
100 |
0 |
return builder.toString(); |
101 |
|
} |
102 |
|
} |