1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package com.xpn.xwiki.criteria.impl; |
21 |
|
|
22 |
|
import java.util.Date; |
23 |
|
|
24 |
|
|
25 |
|
|
26 |
|
|
27 |
|
@version |
28 |
|
@see |
29 |
|
@since |
30 |
|
|
|
|
| 82.9% |
Uncovered Elements: 6 (35) |
Complexity: 15 |
Complexity Density: 0.88 |
|
31 |
|
public class RevisionCriteria |
32 |
|
{ |
33 |
|
|
34 |
|
|
35 |
|
|
36 |
|
private String author = ""; |
37 |
|
|
38 |
|
|
39 |
|
|
40 |
|
|
41 |
|
private Period period = PeriodFactory.createMaximumPeriod(); |
42 |
|
|
43 |
|
|
44 |
|
|
45 |
|
|
46 |
|
private Range range = RangeFactory.createAllRange(); |
47 |
|
|
48 |
|
|
49 |
|
|
50 |
|
|
51 |
|
private boolean includeMinorVersions = false; |
52 |
|
|
53 |
|
|
54 |
|
|
55 |
|
|
56 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
57 |
0 |
public RevisionCriteria()... |
58 |
|
{ |
59 |
|
|
60 |
|
} |
61 |
|
|
62 |
|
|
63 |
|
|
64 |
|
|
|
|
| 76.9% |
Uncovered Elements: 3 (13) |
Complexity: 4 |
Complexity Density: 0.57 |
|
65 |
7 |
public RevisionCriteria(String author, Period period, Range range,... |
66 |
|
boolean includeMinorVersions) |
67 |
|
{ |
68 |
7 |
if (author != null) { |
69 |
7 |
setAuthor(author); |
70 |
|
} |
71 |
7 |
if (period != null) { |
72 |
7 |
setPeriod(period); |
73 |
|
} |
74 |
7 |
if (range != null) { |
75 |
7 |
setRange(range); |
76 |
|
} |
77 |
7 |
setIncludeMinorVersions(includeMinorVersions); |
78 |
|
} |
79 |
|
|
80 |
|
|
81 |
|
@return |
82 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
83 |
22 |
public String getAuthor()... |
84 |
|
{ |
85 |
22 |
return this.author; |
86 |
|
} |
87 |
|
|
88 |
|
|
89 |
|
@param |
90 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
91 |
7 |
public void setAuthor(String author)... |
92 |
|
{ |
93 |
7 |
this.author = author; |
94 |
|
} |
95 |
|
|
96 |
|
|
97 |
|
@return |
98 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
99 |
0 |
public Period getPeriod()... |
100 |
|
{ |
101 |
0 |
return this.period; |
102 |
|
} |
103 |
|
|
104 |
|
|
105 |
|
|
106 |
|
|
107 |
|
@param |
108 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
109 |
7 |
public void setPeriod(Period period)... |
110 |
|
{ |
111 |
7 |
this.period = period; |
112 |
|
} |
113 |
|
|
114 |
|
|
115 |
|
@return |
116 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
117 |
14 |
public Range getRange()... |
118 |
|
{ |
119 |
14 |
return this.range; |
120 |
|
} |
121 |
|
|
122 |
|
|
123 |
|
|
124 |
|
|
125 |
|
@param@see |
126 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
127 |
14 |
public void setRange(Range range)... |
128 |
|
{ |
129 |
14 |
this.range = range; |
130 |
|
} |
131 |
|
|
132 |
|
|
133 |
|
@return |
134 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
135 |
22 |
public Date getMinDate()... |
136 |
|
{ |
137 |
22 |
return new Date(this.period.getStart()); |
138 |
|
} |
139 |
|
|
140 |
|
|
141 |
|
@return |
142 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
143 |
22 |
public Date getMaxDate()... |
144 |
|
{ |
145 |
22 |
return new Date(this.period.getEnd()); |
146 |
|
} |
147 |
|
|
148 |
|
|
149 |
|
|
150 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
151 |
8 |
public boolean getIncludeMinorVersions()... |
152 |
|
{ |
153 |
8 |
return this.includeMinorVersions; |
154 |
|
} |
155 |
|
|
156 |
|
|
157 |
|
@param |
158 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
159 |
7 |
public void setIncludeMinorVersions(boolean includeMinorVersions)... |
160 |
|
{ |
161 |
7 |
this.includeMinorVersions = includeMinorVersions; |
162 |
|
} |
163 |
|
} |