Clover Coverage Report
Coverage timestamp: Fri May 24 2013 13:47:27 UTC
../../../../../img/srcFileCovDistChart10.png 0% of files have more coverage
10   81   9   1.67
6   31   0.9   6
6     1.5  
1    
 
  RuleKey       Line # 25 10 9 100% 1.0
 
  (62)
 
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.common;
17   
18    import org.qedeq.base.utility.EqualsUtility;
19   
20    /**
21    * Rule key, describing a certain version of a rule.
22    *
23    * @author Michael Meyling
24    */
 
25    public final class RuleKey {
26   
27    /** Rule name. */
28    private String name;
29   
30    /** Rule version. */
31    private String version;
32   
33    /**
34    * Constructor.
35    *
36    * @param name Rule name.
37    * @param version Rule argument number.
38    */
 
39  9820 toggle public RuleKey(final String name, final String version) {
40  9820 this.name = name;
41  9820 this.version = version;
42    }
43   
44    /**
45    * Get rule name.
46    *
47    * @return Rule name.
48    */
 
49  86537 toggle public String getName() {
50  86537 return name;
51    }
52   
53    /**
54    * Get rule version.
55    *
56    * @return Rule version.
57    */
 
58  84905 toggle public String getVersion() {
59  84905 return version;
60    }
61   
 
62  31235 toggle public int hashCode() {
63  31235 return (getName() != null ? getName().hashCode() : 0)
64  31235 ^ (getVersion() != null ? getVersion().hashCode() : 0);
65    }
66   
 
67  12032 toggle public boolean equals(final Object obj) {
68  12032 if (!(obj instanceof RuleKey)) {
69  4 return false;
70    }
71  12028 final RuleKey other = (RuleKey) obj;
72  12028 return EqualsUtility.equals(getName(), other.getName())
73    && EqualsUtility.equals(getVersion(), other.getVersion());
74    }
75   
 
76  9 toggle public String toString() {
77  9 return getName() + " [" + getVersion() + "]";
78    }
79   
80   
81    }