1:package business.data;
2:/** Represents a defect and its eventual resolution. */
3:
4:import java.util.Date;
5:
6:public class Defect {
7:
8: private long id;
9: private String description;
10: private int priority;
11: private boolean isResolved;
12: private String resolution;
13: private String submittedBy;
14: private Date submittedOn;
15: private String resolvedBy;
16: private Date resolvedOn;
17:
18: public long getId() {
19: return id;
20: }
21:
22: public void setId(long id) {
23: this.id = id;
24: }
25:
26: public String getDescription() {
27: return description;
28: }
29:
30: public void setDescription(String description) {
31: this.description = description;
32: }
33:
34: public int getPriority() {
35: return priority;
36: }
37:
38: public void setPriority(int priority) {
39: this.priority = priority;
40: }
41:
42:
43: public boolean isIsResolved() {
44: return isResolved;
45: }
46:
47: public void setIsResolved(boolean isResolved) {
48: this.isResolved = isResolved;
49: }
50:
51: public String getResolution() {
52: return resolution;
53: }
54:
55: public void setResolution(String resolution) {
56: this.resolution = resolution;
57: }
58:
59: public String getSubmittedBy() {
60: return submittedBy;
61: }
62:
63: public void setSubmittedBy(String submittedBy) {
64: this.submittedBy = submittedBy;
65: }
66:
67: public Date getSubmittedOn() {
68: return submittedOn;
69: }
70:
71: public void setSubmittedOn(Date submittedOn) {
72: this.submittedOn = submittedOn;
73: }
74:
75: public String getResolvedBy() {
76: return resolvedBy;
77: }
78:
79: public void setResolvedBy(String resolvedBy) {
80: this.resolvedBy = resolvedBy;
81: }
82:
83: public Date getResolvedOn() {
84: return resolvedOn;
85: }
86:
87: public void setResolvedOn(Date resolvedOn) {
88: this.resolvedOn = resolvedOn;
89: }
90:
91: public String getShortDescription() {
92: if ( (this.description != null) && (this.description.length() > 40) ) {
93: return this.description.substring(0,37) + "...";
94: } else {
95: return this.description;
96: }
97: }
98:
99: public String getShortResolution() {
100: if ( (this.resolution != null) && (this.resolution.length() > 40) ) {
101: return this.resolution.substring(0,37) + "...";
102: } else {
103: return this.resolution;
104: }
105: }
106:}