1
2
3
4
5
6 package pt.digitalis.dif.dem.objects.issues;
7
8 import pt.digitalis.dif.controller.interfaces.IDIFContext;
9
10
11
12
13
14
15
16 public class UsageIssue {
17
18
19 private IDIFContext context;
20
21
22 private Exception exception;
23
24
25 private String issueDescription;
26
27
28 private IssueScope issueScope;
29
30
31 private IssueType issueType;
32
33
34 private String location;
35
36
37 private String UID;
38
39
40
41
42
43
44 public IDIFContext getContext()
45 {
46 return context;
47 }
48
49
50
51
52
53
54 public Exception getException()
55 {
56 return this.exception;
57 }
58
59
60
61
62
63
64 public String getIssueDescription()
65 {
66 return this.issueDescription;
67 }
68
69
70
71
72
73
74 public IssueScope getIssueScope()
75 {
76 return this.issueScope;
77 }
78
79
80
81
82
83
84 public IssueType getIssueType()
85 {
86 return this.issueType;
87 }
88
89
90
91
92
93
94 public String getLocation()
95 {
96 return this.location;
97 }
98
99
100
101
102
103
104 public String getUID()
105 {
106 return UID;
107 }
108
109
110
111
112
113
114
115 public void setContext(IDIFContext context)
116 {
117 this.context = context;
118 }
119
120
121
122
123
124
125
126 public void setException(Exception exception)
127 {
128 this.exception = exception;
129 }
130
131
132
133
134
135
136
137 public void setIssueDescription(String issueDescription)
138 {
139 this.issueDescription = issueDescription;
140 }
141
142
143
144
145
146
147
148 public void setIssueScope(IssueScope issueScope)
149 {
150 this.issueScope = issueScope;
151 }
152
153
154
155
156
157
158
159 public void setIssueType(IssueType issueType)
160 {
161 this.issueType = issueType;
162 }
163
164
165
166
167
168
169
170 public void setLocation(String location)
171 {
172 this.location = location;
173 }
174
175
176
177
178
179
180
181 public void setUID(String uID)
182 {
183 UID = uID;
184 }
185
186
187
188
189 @Override
190 public String toString()
191 {
192 final String NEW_LINE = "\n";
193 final String BOUNDARY = "----------------------------------------------------------------------";
194
195 StringBuffer result = new StringBuffer();
196
197 if (getIssueType() != null)
198 result.append("Issue type: " + getIssueType() + NEW_LINE);
199
200 if (getIssueScope() != null)
201 result.append("Issue scope: " + getIssueScope() + NEW_LINE);
202
203 if (getIssueDescription() != null)
204 result.append("Issue description: " + getIssueDescription() + NEW_LINE);
205
206 if (getLocation() != null)
207 result.append("Location: " + getLocation() + NEW_LINE);
208
209 if (getException() != null)
210 result.append("Associated exception: " + getException() + NEW_LINE);
211
212
213 if (result.length() > 0)
214 {
215 result.insert(0, NEW_LINE + BOUNDARY + NEW_LINE);
216 result.append(BOUNDARY);
217 }
218
219 return result.toString();
220 }
221 }