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

Last change on this file since 477 was 477, checked in by pharms, 12 years ago

improved find bugs analysis

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