Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
Action |
|
| 1.3846153846153846;1.385 |
1 | /* | |
2 | * $Id$ | |
3 | */ | |
4 | ||
5 | package org.apache.maven.plugins.changes.model; | |
6 | ||
7 | //---------------------------------/ | |
8 | //- Imported classes and packages -/ | |
9 | //---------------------------------/ | |
10 | ||
11 | import java.util.Date; | |
12 | ||
13 | /** | |
14 | * | |
15 | * A single action done on the project, during this | |
16 | * release. | |
17 | * | |
18 | * | |
19 | * @version $Revision$ $Date$ | |
20 | */ | |
21 | 17 | public class Action implements java.io.Serializable { |
22 | ||
23 | ||
24 | //--------------------------/ | |
25 | //- Class/Member Variables -/ | |
26 | //--------------------------/ | |
27 | ||
28 | /** | |
29 | * | |
30 | * A short description of the action taken. | |
31 | * | |
32 | */ | |
33 | private String action; | |
34 | ||
35 | /** | |
36 | * | |
37 | * | |
38 | * <p>Name of developer who committed the | |
39 | * change.</p> | |
40 | * <p>This <b>MUST</b> be the name of the developer | |
41 | * as described in the developers section of the pom.xml | |
42 | * file.</p> | |
43 | * | |
44 | * | |
45 | */ | |
46 | private String dev; | |
47 | ||
48 | /** | |
49 | * | |
50 | * Name of the person to be credited for this | |
51 | * change. This can be used when a patch is submitted by a | |
52 | * non-committer. | |
53 | * | |
54 | */ | |
55 | private String dueTo; | |
56 | ||
57 | /** | |
58 | * | |
59 | * Email of the person to be credited for this | |
60 | * change. | |
61 | * | |
62 | */ | |
63 | private String dueToEmail; | |
64 | ||
65 | /** | |
66 | * | |
67 | * | |
68 | * <p>Id of the issue related to this change. | |
69 | * This is the id in your issue tracking system.</p> | |
70 | * <p>The Changes plugin will generate a URL out | |
71 | * of this id. The URL is constructed using the value of the | |
72 | * issueLinkTemplate parameter.</p> | |
73 | * <p>See the <a | |
74 | * href="changes-report.html">changes-report mojo</a> for more | |
75 | * details.</p> | |
76 | * | |
77 | * | |
78 | */ | |
79 | private String issue; | |
80 | ||
81 | /** | |
82 | * | |
83 | * | |
84 | * Supported action types are the following: | |
85 | * <ul> | |
86 | * <li>add : added functionnality to the | |
87 | * project.</li> | |
88 | * <li>fix : bug fix for the project.</li> | |
89 | * <li>update : updated some part of the | |
90 | * project.</li> | |
91 | * <li>remove : removed some functionnality from | |
92 | * the project.</li> | |
93 | * </ul> | |
94 | * | |
95 | * | |
96 | */ | |
97 | private String type; | |
98 | ||
99 | /** | |
100 | * | |
101 | * | |
102 | * <p>Id of issue tracking system. If empty | |
103 | * 'default' value will be use.</p> | |
104 | * <p>The Changes plugin will generate a URL out | |
105 | * of this id. The URL is constructed using the value of the | |
106 | * issueLinkTemplatePerSystem parameter.</p> | |
107 | * <p>See the <a | |
108 | * href="changes-report.html">changes-report mojo</a> for more | |
109 | * details.</p> | |
110 | * | |
111 | * | |
112 | */ | |
113 | private String system; | |
114 | ||
115 | /** | |
116 | * fix date. | |
117 | */ | |
118 | private String date; | |
119 | ||
120 | /** | |
121 | * Field fixedIssues. | |
122 | */ | |
123 | private java.util.List fixedIssues; | |
124 | ||
125 | /** | |
126 | * Field dueTos. | |
127 | */ | |
128 | private java.util.List dueTos; | |
129 | ||
130 | ||
131 | //-----------/ | |
132 | //- Methods -/ | |
133 | //-----------/ | |
134 | ||
135 | /** | |
136 | * Method addDueTo. | |
137 | * | |
138 | * @param dueTo | |
139 | */ | |
140 | public void addDueTo(DueTo dueTo) | |
141 | { | |
142 | 0 | if ( !(dueTo instanceof DueTo) ) |
143 | { | |
144 | 0 | throw new ClassCastException( "Action.addDueTos(dueTo) parameter must be instanceof " + DueTo.class.getName() ); |
145 | } | |
146 | 0 | getDueTos().add( dueTo ); |
147 | 0 | } //-- void addDueTo(DueTo) |
148 | ||
149 | /** | |
150 | * Method addFixedIssue. | |
151 | * | |
152 | * @param fixedIssue | |
153 | */ | |
154 | public void addFixedIssue(FixedIssue fixedIssue) | |
155 | { | |
156 | 0 | if ( !(fixedIssue instanceof FixedIssue) ) |
157 | { | |
158 | 0 | throw new ClassCastException( "Action.addFixedIssues(fixedIssue) parameter must be instanceof " + FixedIssue.class.getName() ); |
159 | } | |
160 | 0 | getFixedIssues().add( fixedIssue ); |
161 | 0 | } //-- void addFixedIssue(FixedIssue) |
162 | ||
163 | /** | |
164 | * Get | |
165 | * A short description of the action taken. | |
166 | * | |
167 | * | |
168 | * @return String | |
169 | */ | |
170 | public String getAction() | |
171 | { | |
172 | 6 | return this.action; |
173 | } //-- String getAction() | |
174 | ||
175 | /** | |
176 | * Get fix date. | |
177 | * | |
178 | * @return String | |
179 | */ | |
180 | public String getDate() | |
181 | { | |
182 | 0 | return this.date; |
183 | } //-- String getDate() | |
184 | ||
185 | /** | |
186 | * Get | |
187 | * | |
188 | * <p>Name of developer who committed the | |
189 | * change.</p> | |
190 | * <p>This <b>MUST</b> be the name of the developer | |
191 | * as described in the developers section of the pom.xml | |
192 | * file.</p> | |
193 | * | |
194 | * | |
195 | * | |
196 | * @return String | |
197 | */ | |
198 | public String getDev() | |
199 | { | |
200 | 1 | return this.dev; |
201 | } //-- String getDev() | |
202 | ||
203 | /** | |
204 | * Get | |
205 | * Name of the person to be credited for this | |
206 | * change. This can be used when a patch is submitted by a | |
207 | * non-committer. | |
208 | * | |
209 | * | |
210 | * @return String | |
211 | */ | |
212 | public String getDueTo() | |
213 | { | |
214 | 6 | return this.dueTo; |
215 | } //-- String getDueTo() | |
216 | ||
217 | /** | |
218 | * Get | |
219 | * Email of the person to be credited for this | |
220 | * change. | |
221 | * | |
222 | * | |
223 | * @return String | |
224 | */ | |
225 | public String getDueToEmail() | |
226 | { | |
227 | 1 | return this.dueToEmail; |
228 | } //-- String getDueToEmail() | |
229 | ||
230 | /** | |
231 | * Method getDueTos. | |
232 | * | |
233 | * @return java.util.List | |
234 | */ | |
235 | public java.util.List getDueTos() | |
236 | { | |
237 | 10 | if ( this.dueTos == null ) |
238 | { | |
239 | 5 | this.dueTos = new java.util.ArrayList(); |
240 | } | |
241 | ||
242 | 10 | return this.dueTos; |
243 | } //-- java.util.List getDueTos() | |
244 | ||
245 | /** | |
246 | * Method getFixedIssues. | |
247 | * | |
248 | * @return java.util.List | |
249 | */ | |
250 | public java.util.List getFixedIssues() | |
251 | { | |
252 | 10 | if ( this.fixedIssues == null ) |
253 | { | |
254 | 4 | this.fixedIssues = new java.util.ArrayList(); |
255 | } | |
256 | ||
257 | 10 | return this.fixedIssues; |
258 | } //-- java.util.List getFixedIssues() | |
259 | ||
260 | /** | |
261 | * Get | |
262 | * | |
263 | * <p>Id of the issue related to this change. | |
264 | * This is the id in your issue tracking system.</p> | |
265 | * <p>The Changes plugin will generate a URL out | |
266 | * of this id. The URL is constructed using the value of the | |
267 | * issueLinkTemplate parameter.</p> | |
268 | * <p>See the <a | |
269 | * href="changes-report.html">changes-report mojo</a> for more | |
270 | * details.</p> | |
271 | * | |
272 | * | |
273 | * | |
274 | * @return String | |
275 | */ | |
276 | public String getIssue() | |
277 | { | |
278 | 7 | return this.issue; |
279 | } //-- String getIssue() | |
280 | ||
281 | /** | |
282 | * Get | |
283 | * | |
284 | * <p>Id of issue tracking system. If empty | |
285 | * 'default' value will be use.</p> | |
286 | * <p>The Changes plugin will generate a URL out | |
287 | * of this id. The URL is constructed using the value of the | |
288 | * issueLinkTemplatePerSystem parameter.</p> | |
289 | * <p>See the <a | |
290 | * href="changes-report.html">changes-report mojo</a> for more | |
291 | * details.</p> | |
292 | * | |
293 | * | |
294 | * | |
295 | * @return String | |
296 | */ | |
297 | public String getSystem() | |
298 | { | |
299 | 0 | return this.system; |
300 | } //-- String getSystem() | |
301 | ||
302 | /** | |
303 | * Get | |
304 | * | |
305 | * Supported action types are the following: | |
306 | * <ul> | |
307 | * <li>add : added functionnality to the | |
308 | * project.</li> | |
309 | * <li>fix : bug fix for the project.</li> | |
310 | * <li>update : updated some part of the | |
311 | * project.</li> | |
312 | * <li>remove : removed some functionnality from | |
313 | * the project.</li> | |
314 | * </ul> | |
315 | * | |
316 | * | |
317 | * | |
318 | * @return String | |
319 | */ | |
320 | public String getType() | |
321 | { | |
322 | 81 | return this.type; |
323 | } //-- String getType() | |
324 | ||
325 | /** | |
326 | * Method removeDueTo. | |
327 | * | |
328 | * @param dueTo | |
329 | */ | |
330 | public void removeDueTo(DueTo dueTo) | |
331 | { | |
332 | 0 | if ( !(dueTo instanceof DueTo) ) |
333 | { | |
334 | 0 | throw new ClassCastException( "Action.removeDueTos(dueTo) parameter must be instanceof " + DueTo.class.getName() ); |
335 | } | |
336 | 0 | getDueTos().remove( dueTo ); |
337 | 0 | } //-- void removeDueTo(DueTo) |
338 | ||
339 | /** | |
340 | * Method removeFixedIssue. | |
341 | * | |
342 | * @param fixedIssue | |
343 | */ | |
344 | public void removeFixedIssue(FixedIssue fixedIssue) | |
345 | { | |
346 | 0 | if ( !(fixedIssue instanceof FixedIssue) ) |
347 | { | |
348 | 0 | throw new ClassCastException( "Action.removeFixedIssues(fixedIssue) parameter must be instanceof " + FixedIssue.class.getName() ); |
349 | } | |
350 | 0 | getFixedIssues().remove( fixedIssue ); |
351 | 0 | } //-- void removeFixedIssue(FixedIssue) |
352 | ||
353 | /** | |
354 | * Set | |
355 | * A short description of the action taken. | |
356 | * | |
357 | * | |
358 | * @param action | |
359 | */ | |
360 | public void setAction(String action) | |
361 | { | |
362 | 12 | this.action = action; |
363 | 12 | } //-- void setAction(String) |
364 | ||
365 | /** | |
366 | * Set fix date. | |
367 | * | |
368 | * @param date | |
369 | */ | |
370 | public void setDate(String date) | |
371 | { | |
372 | 11 | this.date = date; |
373 | 11 | } //-- void setDate(String) |
374 | ||
375 | /** | |
376 | * Set | |
377 | * | |
378 | * <p>Name of developer who committed the | |
379 | * change.</p> | |
380 | * <p>This <b>MUST</b> be the name of the developer | |
381 | * as described in the developers section of the pom.xml | |
382 | * file.</p> | |
383 | * | |
384 | * | |
385 | * | |
386 | * @param dev | |
387 | */ | |
388 | public void setDev(String dev) | |
389 | { | |
390 | 12 | this.dev = dev; |
391 | 12 | } //-- void setDev(String) |
392 | ||
393 | /** | |
394 | * Set | |
395 | * Name of the person to be credited for this | |
396 | * change. This can be used when a patch is submitted by a | |
397 | * non-committer. | |
398 | * | |
399 | * | |
400 | * @param dueTo | |
401 | */ | |
402 | public void setDueTo(String dueTo) | |
403 | { | |
404 | 12 | this.dueTo = dueTo; |
405 | 12 | } //-- void setDueTo(String) |
406 | ||
407 | /** | |
408 | * Set | |
409 | * Email of the person to be credited for this | |
410 | * change. | |
411 | * | |
412 | * | |
413 | * @param dueToEmail | |
414 | */ | |
415 | public void setDueToEmail(String dueToEmail) | |
416 | { | |
417 | 12 | this.dueToEmail = dueToEmail; |
418 | 12 | } //-- void setDueToEmail(String) |
419 | ||
420 | /** | |
421 | * Set a list of contibutors for this issue. | |
422 | * | |
423 | * @param dueTos | |
424 | */ | |
425 | public void setDueTos(java.util.List dueTos) | |
426 | { | |
427 | 0 | this.dueTos = dueTos; |
428 | 0 | } //-- void setDueTos(java.util.List) |
429 | ||
430 | /** | |
431 | * Set a list of fix issues. | |
432 | * | |
433 | * @param fixedIssues | |
434 | */ | |
435 | public void setFixedIssues(java.util.List fixedIssues) | |
436 | { | |
437 | 0 | this.fixedIssues = fixedIssues; |
438 | 0 | } //-- void setFixedIssues(java.util.List) |
439 | ||
440 | /** | |
441 | * Set | |
442 | * | |
443 | * <p>Id of the issue related to this change. | |
444 | * This is the id in your issue tracking system.</p> | |
445 | * <p>The Changes plugin will generate a URL out | |
446 | * of this id. The URL is constructed using the value of the | |
447 | * issueLinkTemplate parameter.</p> | |
448 | * <p>See the <a | |
449 | * href="changes-report.html">changes-report mojo</a> for more | |
450 | * details.</p> | |
451 | * | |
452 | * | |
453 | * | |
454 | * @param issue | |
455 | */ | |
456 | public void setIssue(String issue) | |
457 | { | |
458 | 12 | this.issue = issue; |
459 | 12 | } //-- void setIssue(String) |
460 | ||
461 | /** | |
462 | * Set | |
463 | * | |
464 | * <p>Id of issue tracking system. If empty | |
465 | * 'default' value will be use.</p> | |
466 | * <p>The Changes plugin will generate a URL out | |
467 | * of this id. The URL is constructed using the value of the | |
468 | * issueLinkTemplatePerSystem parameter.</p> | |
469 | * <p>See the <a | |
470 | * href="changes-report.html">changes-report mojo</a> for more | |
471 | * details.</p> | |
472 | * | |
473 | * | |
474 | * | |
475 | * @param system | |
476 | */ | |
477 | public void setSystem(String system) | |
478 | { | |
479 | 11 | this.system = system; |
480 | 11 | } //-- void setSystem(String) |
481 | ||
482 | /** | |
483 | * Set | |
484 | * | |
485 | * Supported action types are the following: | |
486 | * <ul> | |
487 | * <li>add : added functionnality to the | |
488 | * project.</li> | |
489 | * <li>fix : bug fix for the project.</li> | |
490 | * <li>update : updated some part of the | |
491 | * project.</li> | |
492 | * <li>remove : removed some functionnality from | |
493 | * the project.</li> | |
494 | * </ul> | |
495 | * | |
496 | * | |
497 | * | |
498 | * @param type | |
499 | */ | |
500 | public void setType(String type) | |
501 | { | |
502 | 12 | this.type = type; |
503 | 12 | } //-- void setType(String) |
504 | ||
505 | ||
506 | 17 | private String modelEncoding = "UTF-8"; |
507 | ||
508 | /** | |
509 | * Set an encoding used for reading/writing the model. | |
510 | * | |
511 | * @param modelEncoding the encoding used when reading/writing the model. | |
512 | */ | |
513 | public void setModelEncoding( String modelEncoding ) | |
514 | { | |
515 | 0 | this.modelEncoding = modelEncoding; |
516 | 0 | } |
517 | ||
518 | /** | |
519 | * @return the current encoding used when reading/writing this model. | |
520 | */ | |
521 | public String getModelEncoding() | |
522 | { | |
523 | 0 | return modelEncoding; |
524 | } | |
525 | } |