1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.jdiagnose;
17
18 import org.jdiagnose.runtime.ResultState;
19
20 /***
21 * Useful for decorating ResultInfo instances.
22 *
23 * @author jmccrindle
24 */
25 public class ResultInfoWrapper implements ResultInfo {
26
27 protected ResultInfo resultInfo;
28
29 /***
30 * @param resultInfo instance that all the methods
31 * delegate to unless overwritten.
32 */
33 public ResultInfoWrapper(ResultInfo resultInfo) {
34 this.resultInfo = resultInfo;
35 }
36
37 /***
38 * @see java.lang.Object#equals(java.lang.Object)
39 */
40 public boolean equals(Object obj) {
41 return resultInfo.equals(obj);
42 }
43
44 /***
45 * @see org.jdiagnose.ResultInfo#getDuration()
46 */
47 public long getDuration() {
48 return resultInfo.getDuration();
49 }
50
51 /***
52 * @see org.jdiagnose.ResultInfo#getFinishTime()
53 */
54 public long getFinishTime() {
55 return resultInfo.getFinishTime();
56 }
57
58 /***
59 * @see org.jdiagnose.ResultInfo#getName()
60 */
61 public String getName() {
62 return resultInfo.getName();
63 }
64
65 /***
66 * @see org.jdiagnose.ResultInfo#getStartTime()
67 */
68 public long getStartTime() {
69 return resultInfo.getStartTime();
70 }
71
72 /***
73 * @see org.jdiagnose.ResultInfo#getState()
74 */
75 public ResultState getState() {
76 return resultInfo.getState();
77 }
78
79 /***
80 * @see java.lang.Object#hashCode()
81 */
82 public int hashCode() {
83 return resultInfo.hashCode();
84 }
85
86 /***
87 * @see java.lang.Object#toString()
88 */
89 public String toString() {
90 return resultInfo.toString();
91 }
92
93 /***
94 * @see org.jdiagnose.ResultInfo#getMessage()
95 */
96 public DiagnosticMessage getMessage() {
97 return resultInfo.getMessage();
98 }
99 }