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

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