1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 package fr.ens.transcriptome.doelan.data;
24
25 import org.apache.log4j.Logger;
26
27 import fr.ens.transcriptome.nividic.platform.PlatformException;
28 import fr.ens.transcriptome.nividic.platform.data.Data;
29 import fr.ens.transcriptome.nividic.platform.data.DataDefaults;
30 import fr.ens.transcriptome.nividic.platform.module.AboutModule;
31 import fr.ens.transcriptome.nividic.platform.module.Module;
32 import fr.ens.transcriptome.nividic.platform.module.ModuleDescription;
33 import fr.ens.transcriptome.nividic.util.SystemUtils;
34
35 /***
36 * Wrapper of QualityUnitTestResult.
37 *
38 * @author Laurent Jourdren
39 */
40 public class QualityUnitTestResultData extends Data implements Module {
41
42
43 private static Logger log = Logger.getLogger(QualityUnitTestResultData.class);
44
45 /***
46 * Get the name of the data.
47 * @return The name of the data
48 */
49 public String getName() {
50 return SystemUtils
51 .getClassNameWithoutPackage(QualityUnitTestResultData.class);
52 }
53
54 /***
55 * Get the format of the data.
56 * @return The name of the format of the data
57 */
58 public String getFormat() {
59 return DataDefaults.OM_FORMAT;
60 }
61
62 /***
63 * Get the type of the data.
64 * @return The type of the data.
65 */
66 public String getType() {
67
68 return DoelanDataDefaults.UNIT_TEST_RESULT_TYPE;
69 }
70
71 /***
72 * Get the class of the data.
73 * @return The class of the data.
74 */
75 public Class getDataClass() {
76 return QualityUnitTestResult.class;
77 }
78
79 /***
80 * Set the Result.
81 * @param result Result to set
82 */
83 public void setData(final QualityUnitTestResult result) {
84
85 try {
86 super.setData(result);
87 } catch (PlatformException e) {
88 log.error("Cast exception");
89 }
90 }
91
92 /***
93 * Get the description of the module.
94 * @return The description of the module
95 */
96 public AboutModule aboutModule() {
97
98 ModuleDescription md = null;
99 try {
100 md = new ModuleDescription("QualityUnitTestResult", "QualityUnitTest result data type");
101 } catch (PlatformException e) {
102 log.error("Unable to create module description");
103 }
104 return md;
105 }
106
107
108
109
110
111 /***
112 * Public constructor.
113 * @param result Result of a QualityUnitTest
114 */
115 public QualityUnitTestResultData(final QualityUnitTestResult result) {
116 setData(result);
117 }
118
119 }