View Javadoc

1   /*
2    * Copyright 2001-2004 The Apache Software Foundation.
3    * 
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.jdiagnose;
17  
18  /***
19   * Default implemenation of the DiagnosticMessage.
20   * 
21   * @author jmccrindle
22   */
23  public class DefaultDiagnosticMessage implements DiagnosticMessage {
24  
25      private String summary;
26      private String body;
27  
28      /***
29       * @param summary
30       * @param body
31       */
32      public DefaultDiagnosticMessage(String summary, String body) {
33          super();
34          this.summary = summary;
35          this.body = body;
36      }
37  
38      /***
39       * @param summary
40       * @param body
41       */
42      public DefaultDiagnosticMessage(String summary) {
43          super();
44          this.summary = summary;
45      }
46  
47      /***
48       * @param message
49       */
50      public DefaultDiagnosticMessage(DiagnosticMessage message) {
51          this.summary = message.getSummary();
52          this.body = message.getBody();
53      }
54  
55      /* (non-Javadoc)
56       * @see org.jdiagnose.DiagnosticMessage#getSummary()
57       */
58      public String getSummary() {
59          return summary;
60      }
61  
62      /* (non-Javadoc)
63       * @see org.jdiagnose.DiagnosticMessage#getBody()
64       */
65      public String getBody() {
66          return body;
67      }
68      
69      public void setBody(String body) {
70          this.body = body;
71      }
72      
73      public void setSummary(String summary) {
74          this.summary = summary;
75      }
76  }