Clover Coverage Report
Coverage timestamp: Fri May 24 2013 13:47:27 UTC
../../../../../../img/srcFileCovDistChart10.png 0% of files have more coverage
16   109   14   1.6
8   50   0.88   10
10     1.4  
1    
 
  ChangedRuleVo       Line # 28 16 14 100% 1.0
 
  (9)
 
1    /* This file is part of the project "Hilbert II" - http://www.qedeq.org
2    *
3    * Copyright 2000-2013, Michael Meyling <mime@qedeq.org>.
4    *
5    * "Hilbert II" is free software; you can redistribute
6    * it and/or modify it under the terms of the GNU General Public
7    * License as published by the Free Software Foundation; either
8    * version 2 of the License, or (at your option) any later version.
9    *
10    * This program is distributed in the hope that it will be useful,
11    * but WITHOUT ANY WARRANTY; without even the implied warranty of
12    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13    * GNU General Public License for more details.
14    */
15   
16    package org.qedeq.kernel.se.dto.module;
17   
18    import org.qedeq.base.utility.EqualsUtility;
19    import org.qedeq.kernel.se.base.module.ChangedRule;
20    import org.qedeq.kernel.se.base.module.LatexList;
21   
22   
23    /**
24    * Rule change.
25    *
26    * @author Michael Meyling
27    */
 
28    public class ChangedRuleVo implements ChangedRule {
29   
30    /** Further proposition description. Normally <code>null</code>. */
31    private LatexList description;
32   
33    /** Rule name. */
34    private String name;
35   
36    /** Rule version. */
37    private String version;
38   
39    /**
40    * Constructs a new rule declaration.
41    */
 
42  210 toggle public ChangedRuleVo() {
43    // nothing to do
44    }
45   
46   
47    /**
48    * Set rule name.
49    *
50    * @param name Rule name.
51    */
 
52  189 toggle public final void setName(final String name) {
53  189 this.name = name;
54    }
55   
 
56  2344 toggle public final String getName() {
57  2344 return name;
58    }
59   
60    /**
61    * Set rule version.
62    *
63    * @param version Rule version.
64    */
 
65  189 toggle public final void setVersion(final String version) {
66  189 this.version = version;
67    }
68   
 
69  1691 toggle public final String getVersion() {
70  1691 return version;
71    }
72   
73    /**
74    * Set description.
75    *
76    * @param description Description.
77    */
 
78  191 toggle public final void setDescription(final LatexListVo description) {
79  191 this.description = description;
80    }
81   
 
82  2017 toggle public LatexList getDescription() {
83  2017 return description;
84    }
85   
 
86  112 toggle public boolean equals(final Object obj) {
87  112 if (!(obj instanceof ChangedRule)) {
88  7 return false;
89    }
90  105 final ChangedRule other = (ChangedRule) obj;
91  105 return EqualsUtility.equals(getName(), other.getName())
92    && EqualsUtility.equals(getVersion(), other.getVersion())
93    && EqualsUtility.equals(getDescription(), other.getDescription());
94    }
95   
 
96  156 toggle public int hashCode() {
97  156 return (getName() != null ? 1 ^ getName().hashCode() : 0)
98  156 ^ (getVersion() != null ? 2 ^ getVersion().hashCode() : 0)
99  156 ^ (getDescription() != null ? 4 ^ getDescription().hashCode() : 0);
100    }
101   
 
102  125 toggle public String toString() {
103  125 final StringBuffer buffer = new StringBuffer();
104  125 buffer.append("Rule change: " + getName() + " [" + getVersion() + "]\n");
105  125 buffer.append("\nDescription:\n");
106  125 buffer.append(getDescription());
107  125 return buffer.toString();
108    }
109    }