source: trunk/autoquest-core-usability/src/main/java/de/ugoe/cs/autoquest/usability/UsabilityDefect.java @ 927

Last change on this file since 927 was 927, checked in by sherbold, 12 years ago
  • added copyright under the Apache License, Version 2.0
File size: 3.2 KB
Line 
1//   Copyright 2012 Georg-August-Universität Göttingen, Germany
2//
3//   Licensed under the Apache License, Version 2.0 (the "License");
4//   you may not use this file except in compliance with the License.
5//   You may obtain a copy of the License at
6//
7//       http://www.apache.org/licenses/LICENSE-2.0
8//
9//   Unless required by applicable law or agreed to in writing, software
10//   distributed under the License is distributed on an "AS IS" BASIS,
11//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12//   See the License for the specific language governing permissions and
13//   limitations under the License.
14
15package de.ugoe.cs.autoquest.usability;
16
17import java.util.Map;
18
19/**
20 * TODO comment
21 *
22 * @version $Revision: $ $Date: 16.07.2012$
23 * @author 2012, last modified by $Author: pharms$
24 */
25public class UsabilityDefect {
26
27    /** */
28    private UsabilityDefectSeverity severity;
29
30    /** */
31    private UsabilityDefectDescription description;
32
33    /** */
34    private Map<String, String> descriptionParameters;
35
36    /**
37     * TODO: comment
38     *
39     * @param medium
40     * @param highTextInputRatio
41     */
42    public UsabilityDefect(UsabilityDefectSeverity severity, UsabilityDefectDescription description)
43    {
44        this(severity, description, null);
45    }
46
47    /**
48     * TODO: comment
49     *
50     * @param medium
51     * @param highTextInputRatio
52     */
53    public UsabilityDefect(UsabilityDefectSeverity    severity,
54                           UsabilityDefectDescription description,
55                           Map<String, String>        parameters)
56    {
57        this.severity = severity;
58        this.description = description;
59        this.descriptionParameters = parameters;
60    }
61
62    /**
63     * TODO: comment
64     *
65     * @return
66     */
67    public UsabilityDefectSeverity getSeverity() {
68        return severity;
69    }
70
71    /**
72     * @param severity
73     *            the severity to set
74     */
75    public void setSeverity(UsabilityDefectSeverity severity) {
76        this.severity = severity;
77    }
78
79    /**
80     * @param description
81     *            the description to set
82     */
83    public void setDescription(UsabilityDefectDescription description) {
84        this.description = description;
85    }
86
87    /**
88   *
89   */
90    public String getParameterizedDescription() {
91        return description.toString(descriptionParameters);
92    }
93
94    /*
95     * (non-Javadoc)
96     *
97     * @see java.lang.Object#equals(java.lang.Object)
98     */
99    @Override
100    public boolean equals(Object obj) {
101        if (obj instanceof UsabilityDefect) {
102            return
103                (severity == ((UsabilityDefect) obj).severity) &&
104                (description == ((UsabilityDefect) obj).description);
105        }
106        else {
107            return false;
108        }
109    }
110
111    /*
112     * (non-Javadoc)
113     *
114     * @see java.lang.Object#hashCode()
115     */
116    @Override
117    public int hashCode() {
118        return severity.hashCode() + description.hashCode();
119    }
120
121    /*
122     * (non-Javadoc)
123     *
124     * @see java.lang.Object#toString()
125     */
126    @Override
127    public String toString() {
128        return "UsabilityDefect(" + severity.name() + ", " + description.name() + ")";
129    }
130
131}
Note: See TracBrowser for help on using the repository browser.