KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > za > org > coefficient > modules > issueTracker > IssueData


1 /*
2  * Coefficient - facilitates project based collaboration
3  * Copyright (C) 2003, Dylan Etkin, CSIR icomtek
4  * PO Box 395
5  * Pretoria 0001, RSA
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  */

19
20 package za.org.coefficient.modules.issueTracker;
21
22 import za.org.coefficient.authentication.CoefficientUser;
23 import za.org.coefficient.core.Project;
24 import za.org.coefficient.modules.issueTracker.DiscussionData;
25 import za.org.coefficient.modules.vote.VoteData;
26 import za.org.coefficient.modules.fileUpload.ProjectFolderItem;
27
28 import java.util.Date JavaDoc;
29 import java.util.List JavaDoc;
30 import java.util.ArrayList JavaDoc;
31 import java.util.Map JavaDoc;
32 import java.util.HashMap JavaDoc;
33
34 /**
35  * @hibernate.class
36  * table="COEFFICIENT_ISSUE"
37  */

38 public class IssueData implements java.io.Serializable JavaDoc {
39     //~ Instance fields ========================================================
40

41     private CoefficientUser author;
42     private CoefficientUser assignedTo;
43     private DiscussionData discussion;
44     private ProjectFolderItem uploads;
45     private VoteData vote;
46     private Date JavaDoc createDate;
47     private Date JavaDoc updatedDate;
48     private Date JavaDoc taskStartDate;
49     private Date JavaDoc taskEndDate;
50     private List JavaDoc issueComponents = new ArrayList JavaDoc();
51     private List JavaDoc affectedVersions = new ArrayList JavaDoc();
52     private List JavaDoc fixVersions = new ArrayList JavaDoc();
53     private List JavaDoc watchers = new ArrayList JavaDoc();
54     private Map JavaDoc duplicates = new HashMap JavaDoc();
55     private Map JavaDoc duplicatedBy = new HashMap JavaDoc();
56     private Map JavaDoc incorporates = new HashMap JavaDoc();
57     private Map JavaDoc partOf = new HashMap JavaDoc();
58     private Map JavaDoc relatesTo = new HashMap JavaDoc();
59     private Map JavaDoc relatedTo = new HashMap JavaDoc();
60     private Long JavaDoc id;
61     private Project project;
62     private String JavaDoc environment;
63     private String JavaDoc priority;
64     private String JavaDoc summary;
65     private String JavaDoc type;
66     private String JavaDoc status;
67     private String JavaDoc resolution;
68     private int percentComplete;
69     private boolean completed;
70     private int taskEstimatedHours;
71
72     //~ Constructors ===========================================================
73

74     public IssueData() {
75         createDate = new Date JavaDoc(System.currentTimeMillis());
76         completed = false;
77         percentComplete = IssueTracker.PERCENT_COMPLETE_START;
78     }
79
80     //~ Methods ================================================================
81

82     public void setAuthor(CoefficientUser author) {
83         this.author = author;
84     }
85
86     /**
87      * Gets the value of name
88      *
89      * @return the value of name
90      * @hibernate.many-to-one
91      * column="AUTHOR_ID"
92      */

93     public CoefficientUser getAuthor() {
94         return this.author;
95     }
96
97     public void setAssignedTo(CoefficientUser assignedTo) {
98         this.assignedTo = assignedTo;
99     }
100
101     /**
102      * Gets the value of name
103      *
104      * @return the value of name
105      * @hibernate.many-to-one
106      * column="ASSIGNED_TO_ID"
107      */

108     public CoefficientUser getAssignedTo() {
109         return this.assignedTo;
110     }
111
112     /**
113      * Sets the value of createDate
114      *
115      * @param argId Value to assign to this.createDate
116      */

117     public void setCreateDate(Date JavaDoc argCreateDate) {
118         this.createDate = argCreateDate;
119     }
120
121     /**
122      * Gets the value of createDate
123      *
124      * @return the value of createDate
125      * @hibernate.property
126      * column="CREATE_DATE"
127      */

128     public Date JavaDoc getCreateDate() {
129         return this.createDate;
130     }
131
132     /**
133      * Sets the value of taskStartDate
134      *
135      * @param argId Value to assign to this.taskStartDate
136      */

137     public void setTaskStartDate(Date JavaDoc argTaskStartDate) {
138         this.taskStartDate = argTaskStartDate;
139     }
140
141     /**
142      * Gets the value of taskStartDate
143      *
144      * @return the value of taskStartDate
145      * @hibernate.property
146      * column="TASK_START_DATE"
147      */

148     public Date JavaDoc getTaskStartDate() {
149         return this.taskStartDate;
150     }
151
152     /**
153      * Sets the value of taskEndDate
154      *
155      * @param argId Value to assign to this.taskEndDate
156      */

157     public void setTaskEndDate(Date JavaDoc argTaskEndDate) {
158         this.taskEndDate = argTaskEndDate;
159     }
160
161     /**
162      * Gets the value of taskEndDate
163      *
164      * @return the value of taskEndDate
165      * @hibernate.property
166      * column="TASK_END_DATE"
167      */

168     public Date JavaDoc getTaskEndDate() {
169         return this.taskEndDate;
170     }
171
172     /**
173      * Sets the value of updatedDate
174      *
175      * @param argId Value to assign to this.updatedDate
176      */

177     public void setUpdatedDate(Date JavaDoc argUpdatedDate) {
178         this.updatedDate = argUpdatedDate;
179     }
180
181     /**
182      * Gets the value of updatedDate
183      *
184      * @return the value of updatedDate
185      * @hibernate.timestamp
186      * column="UPDATED_DATE"
187      */

188     public Date JavaDoc getUpdatedDate() {
189         return this.updatedDate;
190     }
191
192     /**
193      * Sets the value of environment
194      *
195      * @param argEnvironment Value to assign to this.environment
196      */

197     public void setEnvironment(String JavaDoc environment) {
198         this.environment = environment;
199     }
200
201     /**
202      * Gets the value of environment
203      *
204      * @return the value of environment
205      * @hibernate.property
206      * column="ENVIRONMENT"
207      * length="3999"
208      */

209     public String JavaDoc getEnvironment() {
210         return this.environment;
211     }
212
213     /**
214      * Sets the value of priority
215      *
216      * @param argPriority Value to assign to this.priority
217      */

218     public void setPriority(String JavaDoc priority) {
219         this.priority = priority;
220     }
221
222     /**
223      * Gets the value of priority
224      *
225      * @return the value of priority
226      * @hibernate.property
227      * column="PRIORITY"
228      */

229     public String JavaDoc getPriority() {
230         return this.priority;
231     }
232
233     /**
234      * Sets the value of resolution
235      *
236      * @param argResolution Value to assign to this.resolution
237      */

238     public void setResolution(String JavaDoc resolution) {
239         this.resolution = resolution;
240     }
241
242     /**
243      * Gets the value of resolution
244      *
245      * @return the value of resolution
246      * @hibernate.property
247      * column="RESOLUTION"
248      */

249     public String JavaDoc getResolution() {
250         return this.resolution;
251     }
252
253     /**
254      * Sets the value of percentComplete
255      *
256      * @param argPercentComplete Value to assign to this.percentComplete
257      */

258     public void setPercentComplete(int percentComplete) {
259         this.percentComplete = percentComplete;
260         if(this.percentComplete == IssueTracker.PERCENT_COMPLETE_FINISHED) {
261             completed = true;
262         } else {
263             completed = false;
264         }
265     }
266
267     /**
268      * Gets the value of percentComplete
269      *
270      * @return the value of percentComplete
271      * @hibernate.property
272      * column="PERCENT_COMPLETE"
273      */

274     public int getPercentComplete() {
275         return this.percentComplete;
276     }
277
278     /**
279      * Sets the value of status
280      *
281      * @param argStatus Value to assign to this.status
282      */

283     public void setStatus(String JavaDoc status) {
284         if (IssueTracker.STATUS_CLOSED.equals(status)) {
285             percentComplete = IssueTracker.PERCENT_COMPLETE_FINISHED;
286             completed = true;
287         } else {
288             completed = false;
289         }
290         this.status = status;
291     }
292
293     /**
294      * Gets the value of status
295      *
296      * @return the value of status
297      * @hibernate.property
298      * column="STATUS"
299      */

300     public String JavaDoc getStatus() {
301         return this.status;
302     }
303
304     /**
305      * Gets the value of completed
306      *
307      * @return the value of completed
308      * @hibernate.property
309      * column="COMPLETED"
310      * not-null="true"
311      */

312     public boolean getCompleted() {
313         return this.completed;
314     }
315
316     /**
317      * Sets the value of completed
318      *
319      * @param argCompleted Value to assign to this.completed
320      */

321     public void setCompleted(boolean completed){
322         this.completed = completed;
323     }
324
325     /**
326      * Sets the value of id
327      *
328      * @param argId Value to assign to this.id
329      */

330     public void setId(Long JavaDoc argId) {
331         this.id = argId;
332     }
333
334     /**
335      * Gets the value of id
336      *
337      * @return the value of id
338      * @hibernate.id
339      * generator-class="native"
340      */

341     public Long JavaDoc getId() {
342         return this.id;
343     }
344
345     /**
346      * Sets the value of project
347      *
348      * @param argId Value to assign to this.project
349      */

350     public void setProject(Project project) {
351         this.project = project;
352     }
353
354     /**
355      * Gets the value of project
356      *
357      * @return the value of project
358      * @hibernate.many-to-one
359      * column="PROJECT_ID"
360      */

361     public Project getProject() {
362         return this.project;
363     }
364
365     /**
366      * Sets the value of summary
367      *
368      * @param argSummary Value to assign to this.summary
369      */

370     public void setSummary(String JavaDoc summary) {
371         this.summary = summary;
372     }
373
374     /**
375      * Gets the value of summary
376      *
377      * @return the value of summary
378      * @hibernate.property
379      * column="SUMMARY"
380      */

381     public String JavaDoc getSummary() {
382         return this.summary;
383     }
384
385     /**
386      * Sets the value of type
387      *
388      * @param argType Value to assign to this.type
389      */

390     public void setType(String JavaDoc type) {
391         this.type = type;
392     }
393
394     /**
395      * Gets the value of type
396      *
397      * @return the value of type
398      * @hibernate.property
399      * column="TYPE"
400      */

401     public String JavaDoc getType() {
402         return this.type;
403     }
404
405
406     /**
407      * Sets the value of issueComponents
408      *
409      * @param issueComponents Value to assign to this.issueComponents
410      */

411     public void setIssueComponents(List JavaDoc issueComponents) {
412         this.issueComponents = issueComponents;
413     }
414
415     /**
416      * Gets the value of issueComponents
417      *
418      * @return the value of issueComponents
419      * @hibernate.list
420      * cascade="all"
421      * table="COEFFICIENT_ISSUE_COMPONENTS"
422      * @hibernate.collection-key
423      * column="ISSUE_ID"
424      * @hibernate.collection-index
425      * column="IDX"
426      * @hibernate.collection-element
427      * column="ISSUE_COMPONENTS"
428      * type="string"
429      */

430     public List JavaDoc getIssueComponents() {
431         return this.issueComponents;
432     }
433
434     /**
435      * Sets the value of affectedVersions
436      *
437      * @param affectedVersions Value to assign to this.affectedVersions
438      */

439     public void setAffectedVersions(List JavaDoc affectedVersions) {
440         this.affectedVersions = affectedVersions;
441     }
442
443     /**
444      * Gets the value of affectedVersions
445      *
446      * @return the value of affectedVersions
447      * @hibernate.list
448      * cascade="all"
449      * table="COEFFICIENT_ISSUE_AFFECTED_VERSIONS"
450      * @hibernate.collection-key
451      * column="ISSUE_ID"
452      * @hibernate.collection-index
453      * column="IDX"
454      * @hibernate.collection-element
455      * column="AFFECTED_VERSIONS"
456      * type="string"
457      */

458     public List JavaDoc getAffectedVersions() {
459         return this.affectedVersions;
460     }
461
462     /**
463      * Sets the value of fixVersions
464      *
465      * @param fixVersions Value to assign to this.fixVersions
466      */

467     public void setFixVersions(List JavaDoc fixVersions) {
468         this.fixVersions = fixVersions;
469     }
470
471     /**
472      * Gets the value of fixVersions
473      *
474      * @return the value of fixVersions
475      * @hibernate.list
476      * cascade="all"
477      * table="COEFFICIENT_ISSUE_FIX_VERSIONS"
478      * @hibernate.collection-key
479      * column="ISSUE_ID"
480      * @hibernate.collection-index
481      * column="IDX"
482      * @hibernate.collection-element
483      * column="FIX_VERSIONS"
484      * type="string"
485      */

486     public List JavaDoc getFixVersions() {
487         return this.fixVersions;
488     }
489
490     /**
491      * Sets the value of discussion
492      *
493      * @param argDiscussion Value to assign to this.discussion
494      */

495     public void setDiscussion(DiscussionData discussion) {
496         this.discussion = discussion;
497     }
498
499     /**
500      * Gets the value of discussion
501      *
502      * @return the value of discussion
503      * @hibernate.many-to-one
504      * column="DISCUSSION"
505      */

506     public DiscussionData getDiscussion() {
507         return this.discussion;
508     }
509
510     /**
511      * Sets the value of uploads
512      *
513      * @param argUploads Value to assign to this.uploads
514      */

515     public void setUploads(ProjectFolderItem uploads) {
516         this.uploads = uploads;
517     }
518
519     /**
520      * Gets the value of uploads
521      *
522      * @return the value of uploads
523      * @hibernate.many-to-one
524      * column="UPLOADS"
525      */

526     public ProjectFolderItem getUploads() {
527         return this.uploads;
528     }
529
530     /**
531      * Sets the value of vote
532      *
533      * @param argVote Value to assign to this.vote
534      */

535     public void setVote(VoteData vote) {
536         this.vote = vote;
537     }
538
539     /**
540      * Gets the value of vote
541      *
542      * @return the value of vote
543      * @hibernate.many-to-one
544      * column="VOTE"
545      */

546     public VoteData getVote() {
547         return this.vote;
548     }
549
550     /**
551      * Sets the value of watchers
552      *
553      * @param argWatchers Value to assign to this.watchers
554      */

555     public void setWatchers(List JavaDoc argWatchers) {
556         this.watchers = argWatchers;
557     }
558
559     /**
560      * Gets the value of watchers
561      *
562      * @return the value of watchers
563      * @hibernate.list
564      * table="COEFFICIENT_ISSUE_WATCHERS"
565      * @hibernate.collection-key
566      * column="ISSUE_ID"
567      * @hibernate.collection-index
568      * column="IDX"
569      * @hibernate.collection-many-to-many
570      * class="za.org.coefficient.authentication.CoefficientUser"
571      * column="WATCHERS"
572      */

573     public List JavaDoc getWatchers() {
574         return this.watchers;
575     }
576
577     public void addWatcher(CoefficientUser user) {
578         this.watchers.add(user);
579     }
580
581     public void removeWatcher(CoefficientUser user) {
582         int idx = this.watchers.indexOf(user);
583         if (idx != -1) {
584             this.watchers.remove(idx);
585         }
586     }
587
588     /**
589      * Sets the value of duplicates
590      *
591      * @param argDuplicates Value to assign to this.duplicates
592      */

593     public void setDuplicates(Map JavaDoc argDuplicates) {
594         this.duplicates = argDuplicates;
595     }
596
597     /**
598      * Gets the value of duplicates
599      *
600      * @return the value of duplicates
601      * @hibernate.map
602      * cascade="all"
603      * table="COEFFICIENT_ISSUE_DUPLICATES"
604      * @hibernate.collection-key
605      * column="ISSUE_ID"
606      * @hibernate.collection-index
607      * column="IDX"
608      * type="long"
609      * @hibernate.collection-element
610      * type="string"
611      * column="ISSUE_SUMMARY"
612      */

613     public Map JavaDoc getDuplicates() {
614         return this.duplicates;
615     }
616
617     public void addDuplicates(Long JavaDoc id, String JavaDoc desc){
618         this.duplicates.put(id, desc);
619     }
620
621     public void removeDuplicates(Long JavaDoc id) {
622         this.duplicates.remove(id);
623     }
624
625     /**
626      * Sets the value of duplicatedBy
627      *
628      * @param argDuplicatedBy Value to assign to this.duplicatedBy
629      */

630     public void setDuplicatedBy(Map JavaDoc argDuplicatedBy) {
631         this.duplicatedBy = argDuplicatedBy;
632     }
633
634     /**
635      * Gets the value of duplicatedBy
636      *
637      * @return the value of duplicatedBy
638      * @hibernate.map
639      * cascade="all"
640      * table="COEFFICIENT_ISSUE_DUPLICATED_BY"
641      * @hibernate.collection-key
642      * column="ISSUE_ID"
643      * @hibernate.collection-index
644      * column="IDX"
645      * type="long"
646      * @hibernate.collection-element
647      * type="string"
648      * column="ISSUE_SUMMARY"
649      */

650     public Map JavaDoc getDuplicatedBy() {
651         return this.duplicatedBy;
652     }
653
654     public void addDuplicatedBy(Long JavaDoc id, String JavaDoc desc){
655         this.duplicatedBy.put(id, desc);
656     }
657
658     public void removeDuplicatedBy(Long JavaDoc id) {
659         this.duplicatedBy.remove(id);
660     }
661
662     /**
663      * Sets the value of incorporates
664      *
665      * @param argIncorporates Value to assign to this.incorporates
666      */

667     public void setIncorporates(Map JavaDoc argIncorporates) {
668         this.incorporates = argIncorporates;
669     }
670
671     /**
672      * Gets the value of incorporates
673      *
674      * @return the value of incorporates
675      * @hibernate.map
676      * cascade="all"
677      * table="COEFFICIENT_ISSUE_INCORPORATES"
678      * @hibernate.collection-key
679      * column="ISSUE_ID"
680      * @hibernate.collection-index
681      * column="IDX"
682      * type="long"
683      * @hibernate.collection-element
684      * type="string"
685      * column="ISSUE_SUMMARY"
686      */

687     public Map JavaDoc getIncorporates() {
688         return this.incorporates;
689     }
690
691     public void addIncorporates(Long JavaDoc id, String JavaDoc desc){
692         this.incorporates.put(id, desc);
693     }
694
695     public void removeIncorporates(Long JavaDoc id) {
696         this.incorporates.remove(id);
697     }
698
699     /**
700      * Sets the value of partOf
701      *
702      * @param argPartOf Value to assign to this.partOf
703      */

704     public void setPartOf(Map JavaDoc argPartOf) {
705         this.partOf = argPartOf;
706     }
707
708     /**
709      * Gets the value of partOf
710      *
711      * @return the value of partOf
712      * @hibernate.map
713      * cascade="all"
714      * table="COEFFICIENT_ISSUE_PART_OF"
715      * @hibernate.collection-key
716      * column="ISSUE_ID"
717      * @hibernate.collection-index
718      * column="IDX"
719      * type="long"
720      * @hibernate.collection-element
721      * type="string"
722      * column="ISSUE_SUMMARY"
723      */

724     public Map JavaDoc getPartOf() {
725         return this.partOf;
726     }
727
728     public void addPartOf(Long JavaDoc id, String JavaDoc desc){
729         this.partOf.put(id, desc);
730     }
731
732     public void removePartOf(Long JavaDoc id) {
733         this.partOf.remove(id);
734     }
735
736     /**
737      * Sets the value of relatesTo
738      *
739      * @param argRelatesTo Value to assign to this.relatesTo
740      */

741     public void setRelatesTo(Map JavaDoc argRelatesTo) {
742         this.relatesTo = argRelatesTo;
743     }
744
745     /**
746      * Gets the value of relatesTo
747      *
748      * @return the value of relatesTo
749      * @hibernate.map
750      * cascade="all"
751      * table="COEFFICIENT_ISSUE_RELATES_TO"
752      * @hibernate.collection-key
753      * column="ISSUE_ID"
754      * @hibernate.collection-index
755      * column="IDX"
756      * type="long"
757      * @hibernate.collection-element
758      * type="string"
759      * column="ISSUE_SUMMARY"
760      */

761     public Map JavaDoc getRelatesTo() {
762         return this.relatesTo;
763     }
764
765     public void addRelatesTo(Long JavaDoc id, String JavaDoc desc){
766         this.relatesTo.put(id, desc);
767     }
768
769     public void removeRelatesTo(Long JavaDoc id) {
770         this.relatesTo.remove(id);
771     }
772
773     /**
774      * Sets the value of relatedTo
775      *
776      * @param argRelatedTo Value to assign to this.relatedTo
777      */

778     public void setRelatedTo(Map JavaDoc argRelatedTo) {
779         this.relatedTo = argRelatedTo;
780     }
781
782     /**
783      * Gets the value of relatedTo
784      *
785      * @return the value of relatedTo
786      * @hibernate.map
787      * cascade="all"
788      * table="COEFFICIENT_ISSUE_RELATED_TO"
789      * @hibernate.collection-key
790      * column="ISSUE_ID"
791      * @hibernate.collection-index
792      * column="IDX"
793      * type="long"
794      * @hibernate.collection-element
795      * type="string"
796      * column="ISSUE_SUMMARY"
797      */

798     public Map JavaDoc getRelatedTo() {
799         return this.relatedTo;
800     }
801
802     public void addRelatedTo(Long JavaDoc id, String JavaDoc desc){
803         this.relatedTo.put(id, desc);
804     }
805
806     public void removeRelatedTo(Long JavaDoc id) {
807         this.relatedTo.remove(id);
808     }
809
810     /**
811      * Gets the value of estimatedHours
812      *
813      * @return the value of estimatedHours
814      * @hibernate.property
815      * column="TASK_ESTIMATED_HOURS"
816      */

817     public int getTaskEstimatedHours() {
818         return this.taskEstimatedHours;
819     }
820
821     /**
822      * Sets the value of taskEstimatedHours
823      *
824      * @param argId Value to assign to this.taskEstimatedHours
825      */

826     public void setTaskEstimatedHours(int argTaskEstimatedHours){
827         this.taskEstimatedHours = argTaskEstimatedHours;
828     }
829 }
830
Popular Tags