View Javadoc

1   /**
2    * 2008, Digitalis Informatica. All rights reserved. Distribuicao e Gestao de Informatica, Lda. Estrada de Paco de Arcos
3    * num.9 - Piso -1 2780-666 Paco de Arcos Telefone: (351) 21 4408990 Fax: (351) 21 4408999 http://www.digitalis.pt
4    */
5   
6   package pt.digitalis.dif.dem.objects.issues;
7   
8   import pt.digitalis.dif.controller.interfaces.IDIFContext;
9   
10  /**
11   * Usage issue bean.
12   * 
13   * @author Rodrigo Gonçalves <a href="mailto:rgoncalves@digitalis.pt">rgoncalves@digitalis.pt</a><br/>
14   * @created 2008/11/13
15   */
16  public class UsageIssue {
17  
18      /**  */
19      private IDIFContext context;
20  
21      /** The exception that might be associated to the issue. */
22      private Exception exception;
23  
24      /** The issue description. */
25      private String issueDescription;
26  
27      /** The issue scope. */
28      private IssueScope issueScope;
29  
30      /** The issue type. */
31      private IssueType issueType;
32  
33      /** The location where the issue happened. */
34      private String location;
35  
36      /** the private UID */
37      private String UID;
38  
39      /**
40       * Inspector for the 'context' attribute.
41       * 
42       * @return the context value
43       */
44      public IDIFContext getContext()
45      {
46          return context;
47      }
48  
49      /**
50       * Inspector for the 'exception' attribute.
51       * 
52       * @return the exception value
53       */
54      public Exception getException()
55      {
56          return this.exception;
57      }
58  
59      /**
60       * Inspector for the 'issueDescription' attribute.
61       * 
62       * @return the issueDescription value
63       */
64      public String getIssueDescription()
65      {
66          return this.issueDescription;
67      }
68  
69      /**
70       * Inspector for the 'issueScope' attribute.
71       * 
72       * @return the issueScope value
73       */
74      public IssueScope getIssueScope()
75      {
76          return this.issueScope;
77      }
78  
79      /**
80       * Inspector for the 'issueType' attribute.
81       * 
82       * @return the issueType value
83       */
84      public IssueType getIssueType()
85      {
86          return this.issueType;
87      }
88  
89      /**
90       * Inspector for the 'location' attribute.
91       * 
92       * @return the location value
93       */
94      public String getLocation()
95      {
96          return this.location;
97      }
98  
99      /**
100      * Inspector for the 'UID' attribute.
101      * 
102      * @return the uID value
103      */
104     public String getUID()
105     {
106         return UID;
107     }
108 
109     /**
110      * Modifier for the 'context' attribute.
111      * 
112      * @param context
113      *            the new context value to set
114      */
115     public void setContext(IDIFContext context)
116     {
117         this.context = context;
118     }
119 
120     /**
121      * Modifier for the 'exception' attribute.
122      * 
123      * @param exception
124      *            the new exception value to set
125      */
126     public void setException(Exception exception)
127     {
128         this.exception = exception;
129     }
130 
131     /**
132      * Modifier for the 'issueDescription' attribute.
133      * 
134      * @param issueDescription
135      *            the new issueDescription value to set
136      */
137     public void setIssueDescription(String issueDescription)
138     {
139         this.issueDescription = issueDescription;
140     }
141 
142     /**
143      * Modifier for the 'issueScope' attribute.
144      * 
145      * @param issueScope
146      *            the new issueScope value to set
147      */
148     public void setIssueScope(IssueScope issueScope)
149     {
150         this.issueScope = issueScope;
151     }
152 
153     /**
154      * Modifier for the 'issueType' attribute.
155      * 
156      * @param issueType
157      *            the new issueType value to set
158      */
159     public void setIssueType(IssueType issueType)
160     {
161         this.issueType = issueType;
162     }
163 
164     /**
165      * Modifier for the 'location' attribute.
166      * 
167      * @param location
168      *            the new theEntity value to set
169      */
170     public void setLocation(String location)
171     {
172         this.location = location;
173     }
174 
175     /**
176      * Modifier for the 'UID' attribute.
177      * 
178      * @param uID
179      *            the new uID value to set
180      */
181     public void setUID(String uID)
182     {
183         UID = uID;
184     }
185 
186     /**
187      * @see java.lang.Object#toString()
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         // If there's data to print add boundaries
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 }