1 | package de.ugoe.cs.autoquest.usability; |
---|
2 | |
---|
3 | import java.util.Map; |
---|
4 | |
---|
5 | /** |
---|
6 | * TODO comment |
---|
7 | * |
---|
8 | * @version $Revision: $ $Date: 16.07.2012$ |
---|
9 | * @author 2012, last modified by $Author: pharms$ |
---|
10 | */ |
---|
11 | public class UsabilityDefect { |
---|
12 | |
---|
13 | /** */ |
---|
14 | private UsabilityDefectSeverity severity; |
---|
15 | |
---|
16 | /** */ |
---|
17 | private UsabilityDefectDescription description; |
---|
18 | |
---|
19 | /** */ |
---|
20 | private Map<String, String> descriptionParameters; |
---|
21 | |
---|
22 | /** |
---|
23 | * TODO: comment |
---|
24 | * |
---|
25 | * @param medium |
---|
26 | * @param highTextInputRatio |
---|
27 | */ |
---|
28 | public UsabilityDefect(UsabilityDefectSeverity severity, UsabilityDefectDescription description) |
---|
29 | { |
---|
30 | this(severity, description, null); |
---|
31 | } |
---|
32 | |
---|
33 | /** |
---|
34 | * TODO: comment |
---|
35 | * |
---|
36 | * @param medium |
---|
37 | * @param highTextInputRatio |
---|
38 | */ |
---|
39 | public UsabilityDefect(UsabilityDefectSeverity severity, |
---|
40 | UsabilityDefectDescription description, |
---|
41 | Map<String, String> parameters) |
---|
42 | { |
---|
43 | this.severity = severity; |
---|
44 | this.description = description; |
---|
45 | this.descriptionParameters = parameters; |
---|
46 | } |
---|
47 | |
---|
48 | /** |
---|
49 | * TODO: comment |
---|
50 | * |
---|
51 | * @return |
---|
52 | */ |
---|
53 | public UsabilityDefectSeverity getSeverity() { |
---|
54 | return severity; |
---|
55 | } |
---|
56 | |
---|
57 | /** |
---|
58 | * @param severity |
---|
59 | * the severity to set |
---|
60 | */ |
---|
61 | public void setSeverity(UsabilityDefectSeverity severity) { |
---|
62 | this.severity = severity; |
---|
63 | } |
---|
64 | |
---|
65 | /** |
---|
66 | * @param description |
---|
67 | * the description to set |
---|
68 | */ |
---|
69 | public void setDescription(UsabilityDefectDescription description) { |
---|
70 | this.description = description; |
---|
71 | } |
---|
72 | |
---|
73 | /** |
---|
74 | * |
---|
75 | */ |
---|
76 | public String getParameterizedDescription() { |
---|
77 | return description.toString(descriptionParameters); |
---|
78 | } |
---|
79 | |
---|
80 | /* |
---|
81 | * (non-Javadoc) |
---|
82 | * |
---|
83 | * @see java.lang.Object#equals(java.lang.Object) |
---|
84 | */ |
---|
85 | @Override |
---|
86 | public boolean equals(Object obj) { |
---|
87 | if (obj instanceof UsabilityDefect) { |
---|
88 | return |
---|
89 | (severity == ((UsabilityDefect) obj).severity) && |
---|
90 | (description == ((UsabilityDefect) obj).description); |
---|
91 | } |
---|
92 | else { |
---|
93 | return false; |
---|
94 | } |
---|
95 | } |
---|
96 | |
---|
97 | /* |
---|
98 | * (non-Javadoc) |
---|
99 | * |
---|
100 | * @see java.lang.Object#hashCode() |
---|
101 | */ |
---|
102 | @Override |
---|
103 | public int hashCode() { |
---|
104 | return severity.hashCode() + description.hashCode(); |
---|
105 | } |
---|
106 | |
---|
107 | /* |
---|
108 | * (non-Javadoc) |
---|
109 | * |
---|
110 | * @see java.lang.Object#toString() |
---|
111 | */ |
---|
112 | @Override |
---|
113 | public String toString() { |
---|
114 | return "UsabilityDefect(" + severity.name() + ", " + description.name() + ")"; |
---|
115 | } |
---|
116 | |
---|
117 | } |
---|