1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package org.xwiki.extension.job.history; |
21 |
|
|
22 |
|
import java.util.ArrayList; |
23 |
|
import java.util.Collections; |
24 |
|
import java.util.Date; |
25 |
|
import java.util.List; |
26 |
|
import java.util.Map; |
27 |
|
|
28 |
|
import org.apache.commons.lang3.StringUtils; |
29 |
|
import org.xwiki.extension.job.ExtensionRequest; |
30 |
|
|
31 |
|
|
32 |
|
@link |
33 |
|
|
34 |
|
@version |
35 |
|
@since |
36 |
|
|
|
|
| 85.2% |
Uncovered Elements: 4 (27) |
Complexity: 9 |
Complexity Density: 0.56 |
|
37 |
|
public class ExtensionJobHistoryRecord |
38 |
|
{ |
39 |
|
private final String jobType; |
40 |
|
|
41 |
|
private final ExtensionRequest request; |
42 |
|
|
43 |
|
private final Map<String, QuestionRecorder<Object>> answers; |
44 |
|
|
45 |
|
private final Date startDate; |
46 |
|
|
47 |
|
private final Date endDate; |
48 |
|
|
49 |
|
|
50 |
|
|
51 |
|
|
52 |
|
@param |
53 |
|
@param |
54 |
|
@param |
55 |
|
|
56 |
|
|
57 |
|
@param |
58 |
|
@param |
59 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (7) |
Complexity: 2 |
Complexity Density: 0.4 |
|
60 |
111 |
public ExtensionJobHistoryRecord(String jobType, ExtensionRequest request,... |
61 |
|
Map<String, QuestionRecorder<Object>> answers, Date startDate, Date endDate) |
62 |
|
{ |
63 |
111 |
this.jobType = jobType; |
64 |
111 |
this.request = request; |
65 |
111 |
this.answers = |
66 |
111 |
answers != null ? Collections.unmodifiableMap(answers) : Collections |
67 |
|
.<String, QuestionRecorder<Object>>emptyMap(); |
68 |
111 |
this.startDate = startDate; |
69 |
111 |
this.endDate = endDate; |
70 |
|
} |
71 |
|
|
72 |
|
|
73 |
|
@return |
74 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
75 |
9 |
public String getJobType()... |
76 |
|
{ |
77 |
9 |
return jobType; |
78 |
|
} |
79 |
|
|
80 |
|
|
81 |
|
@return |
82 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
83 |
26 |
public ExtensionRequest getRequest()... |
84 |
|
{ |
85 |
26 |
return request; |
86 |
|
} |
87 |
|
|
88 |
|
|
89 |
|
@return |
90 |
|
|
91 |
|
|
92 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
93 |
2 |
public Map<String, QuestionRecorder<Object>> getAnswers()... |
94 |
|
{ |
95 |
2 |
return answers; |
96 |
|
} |
97 |
|
|
98 |
|
|
99 |
|
@return |
100 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
101 |
1 |
public Date getStartDate()... |
102 |
|
{ |
103 |
1 |
return startDate; |
104 |
|
} |
105 |
|
|
106 |
|
|
107 |
|
@return |
108 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
109 |
0 |
public Date getEndDate()... |
110 |
|
{ |
111 |
0 |
return endDate; |
112 |
|
} |
113 |
|
|
114 |
|
|
115 |
|
@return |
116 |
|
|
|
|
| 75% |
Uncovered Elements: 2 (8) |
Complexity: 2 |
Complexity Density: 0.33 |
|
117 |
2 |
public String getId()... |
118 |
|
{ |
119 |
2 |
List<Object> parts = new ArrayList<>(); |
120 |
2 |
parts.add(this.endDate.getTime()); |
121 |
2 |
parts.add(this.jobType); |
122 |
2 |
if (this.request.hasNamespaces()) { |
123 |
0 |
parts.addAll(this.request.getNamespaces()); |
124 |
|
} |
125 |
2 |
return StringUtils.join(parts, '-'); |
126 |
|
} |
127 |
|
} |