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

Last change on this file since 1493 was 1493, checked in by pharms, 10 years ago
  • state of the HCSE 2014 Paper. An appropriate tag will follow.
File size: 3.1 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.List;
18import java.util.Map;
19
20/**
21 * TODO comment
22 *
23 * @version $Revision: $ $Date: 16.07.2012$
24 * @author 2012, last modified by $Author: pharms$
25 */
26public class UsabilityDefect {
27
28    /** */
29    private UsabilityDefectSeverity severity;
30
31    /** */
32    private UsabilityDefectDescription description;
33
34    /** */
35    private Map<String, Object> descriptionParameters;
36
37    /**
38     *
39     */
40    UsabilityDefect(UsabilityDefectSeverity severity, UsabilityDefectDescription description) {
41        this(severity, description, null);
42    }
43
44    /**
45     *
46     */
47    UsabilityDefect(UsabilityDefectSeverity    severity,
48                    UsabilityDefectDescription description,
49                    Map<String, Object>        parameters)
50    {
51        this.severity = severity;
52        this.description = description;
53        this.descriptionParameters = parameters;
54    }
55
56    /**
57     *
58     */
59    public UsabilityDefectSeverity getSeverity() {
60        return severity;
61    }
62
63    /**
64     *
65     */
66    public void setSeverity(UsabilityDefectSeverity severity) {
67        this.severity = severity;
68    }
69
70    /**
71     *
72     */
73    public void setDescription(UsabilityDefectDescription description) {
74        this.description = description;
75    }
76
77    /**
78     *
79     */
80    public String getParameterizedDescription() {
81        return description.toString(descriptionParameters);
82    }
83
84    /**
85     *
86     */
87    public List<Object> getDescriptionFragments() {
88        return description.toFragmentList(descriptionParameters);
89    }
90
91    /*
92     */
93    public String getBriefDescription() {
94        return description.getBriefDescription();
95    }
96
97    /*
98     * (non-Javadoc)
99     *
100     * @see java.lang.Object#equals(java.lang.Object)
101     */
102    @Override
103    public boolean equals(Object obj) {
104        if (obj instanceof UsabilityDefect) {
105            return
106                (severity == ((UsabilityDefect) obj).severity) &&
107                (description == ((UsabilityDefect) obj).description);
108        }
109        else {
110            return false;
111        }
112    }
113
114    /*
115     * (non-Javadoc)
116     *
117     * @see java.lang.Object#hashCode()
118     */
119    @Override
120    public int hashCode() {
121        return severity.hashCode() + description.hashCode();
122    }
123
124    /*
125     * (non-Javadoc)
126     *
127     * @see java.lang.Object#toString()
128     */
129    @Override
130    public String toString() {
131        return "UsabilityDefect(" + severity.name() + ", " + description.name() + ")";
132    }
133
134}
Note: See TracBrowser for help on using the repository browser.