[927] | 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 | |
---|
[922] | 15 | package de.ugoe.cs.autoquest.usability; |
---|
[442] | 16 | |
---|
| 17 | import 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 | */ |
---|
[561] | 25 | public class UsabilityDefect { |
---|
[442] | 26 | |
---|
[561] | 27 | /** */ |
---|
| 28 | private UsabilityDefectSeverity severity; |
---|
[442] | 29 | |
---|
[561] | 30 | /** */ |
---|
| 31 | private UsabilityDefectDescription description; |
---|
[442] | 32 | |
---|
[561] | 33 | /** */ |
---|
| 34 | private Map<String, String> descriptionParameters; |
---|
[442] | 35 | |
---|
[561] | 36 | /** |
---|
[1301] | 37 | * |
---|
[561] | 38 | */ |
---|
| 39 | public UsabilityDefect(UsabilityDefectSeverity severity, UsabilityDefectDescription description) |
---|
| 40 | { |
---|
| 41 | this(severity, description, null); |
---|
| 42 | } |
---|
[442] | 43 | |
---|
[561] | 44 | /** |
---|
[1301] | 45 | * |
---|
[561] | 46 | */ |
---|
| 47 | public UsabilityDefect(UsabilityDefectSeverity severity, |
---|
| 48 | UsabilityDefectDescription description, |
---|
| 49 | Map<String, String> parameters) |
---|
| 50 | { |
---|
| 51 | this.severity = severity; |
---|
| 52 | this.description = description; |
---|
| 53 | this.descriptionParameters = parameters; |
---|
| 54 | } |
---|
[442] | 55 | |
---|
[561] | 56 | /** |
---|
| 57 | * |
---|
| 58 | */ |
---|
| 59 | public UsabilityDefectSeverity getSeverity() { |
---|
| 60 | return severity; |
---|
| 61 | } |
---|
[442] | 62 | |
---|
[561] | 63 | /** |
---|
[1301] | 64 | * |
---|
[561] | 65 | */ |
---|
| 66 | public void setSeverity(UsabilityDefectSeverity severity) { |
---|
| 67 | this.severity = severity; |
---|
| 68 | } |
---|
[442] | 69 | |
---|
[561] | 70 | /** |
---|
[1301] | 71 | * |
---|
[561] | 72 | */ |
---|
| 73 | public void setDescription(UsabilityDefectDescription description) { |
---|
| 74 | this.description = description; |
---|
| 75 | } |
---|
| 76 | |
---|
| 77 | /** |
---|
[1301] | 78 | * |
---|
| 79 | */ |
---|
[561] | 80 | public String getParameterizedDescription() { |
---|
| 81 | return description.toString(descriptionParameters); |
---|
| 82 | } |
---|
[442] | 83 | |
---|
[561] | 84 | /* |
---|
| 85 | * (non-Javadoc) |
---|
| 86 | * |
---|
| 87 | * @see java.lang.Object#equals(java.lang.Object) |
---|
| 88 | */ |
---|
| 89 | @Override |
---|
| 90 | public boolean equals(Object obj) { |
---|
| 91 | if (obj instanceof UsabilityDefect) { |
---|
| 92 | return |
---|
| 93 | (severity == ((UsabilityDefect) obj).severity) && |
---|
| 94 | (description == ((UsabilityDefect) obj).description); |
---|
| 95 | } |
---|
| 96 | else { |
---|
| 97 | return false; |
---|
| 98 | } |
---|
[442] | 99 | } |
---|
[561] | 100 | |
---|
| 101 | /* |
---|
| 102 | * (non-Javadoc) |
---|
| 103 | * |
---|
| 104 | * @see java.lang.Object#hashCode() |
---|
| 105 | */ |
---|
| 106 | @Override |
---|
| 107 | public int hashCode() { |
---|
| 108 | return severity.hashCode() + description.hashCode(); |
---|
[442] | 109 | } |
---|
| 110 | |
---|
[561] | 111 | /* |
---|
| 112 | * (non-Javadoc) |
---|
| 113 | * |
---|
| 114 | * @see java.lang.Object#toString() |
---|
| 115 | */ |
---|
| 116 | @Override |
---|
| 117 | public String toString() { |
---|
| 118 | return "UsabilityDefect(" + severity.name() + ", " + description.name() + ")"; |
---|
| 119 | } |
---|
[477] | 120 | |
---|
[442] | 121 | } |
---|