Clover Coverage Report
Coverage timestamp: Sa Aug 2 2008 13:56:27 CEST
../../../../../img/srcFileCovDistChart10.png 0% of files have more coverage
15   116   12   1,36
8   52   0,8   11
11     1,09  
1    
 
  SpecificationVo       Line # 34 15 12 100% 1.0
 
  (42)
 
1    /* $Id: SpecificationVo.java,v 1.8 2008/07/26 07:59:35 m31 Exp $
2    *
3    * This file is part of the project "Hilbert II" - http://www.qedeq.org
4    *
5    * Copyright 2000-2008, Michael Meyling <mime@qedeq.org>.
6    *
7    * "Hilbert II" is free software; you can redistribute
8    * it and/or modify it under the terms of the GNU General Public
9    * License as published by the Free Software Foundation; either
10    * version 2 of the License, or (at your option) any later version.
11    *
12    * This program is distributed in the hope that it will be useful,
13    * but WITHOUT ANY WARRANTY; without even the implied warranty of
14    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15    * GNU General Public License for more details.
16    */
17   
18    package org.qedeq.kernel.dto.module;
19   
20    import org.qedeq.base.utility.EqualsUtility;
21    import org.qedeq.kernel.base.module.LocationList;
22    import org.qedeq.kernel.base.module.Specification;
23   
24   
25    /**
26    * Describes a specification of a module, that means its name, versions and possible
27    * "physical" locations.
28    * The combination of {@link #getName()} and {@link #getRuleVersion()} defines the
29    * file name of that module.
30    *
31    * @version $Revision: 1.8 $
32    * @author Michael Meyling
33    */
 
34    public class SpecificationVo implements Specification {
35   
36    /** Module name. */
37    private String name;
38   
39    /** Rule version, that is needed to verify the module. */
40    private String ruleVersion;
41   
42    /** List of locations for the module. */
43    private LocationList locationList;
44   
45    /**
46    * Constructs a module specification. The combination of <code>name</code> and
47    * <code>ruleVersion</code> defines the file name of that module.
48    *
49    * @param name Module name.
50    * @param ruleVersion Rule version. This version is at least needed to verify that module.
51    * @param locations List of locations for that module.
52    */
 
53  313 toggle public SpecificationVo(final String name, final String ruleVersion,
54    final LocationList locations) {
55  313 this.name = name;
56  313 this.ruleVersion = ruleVersion;
57  313 this.locationList = locations;
58    }
59   
60    /**
61    * Constructs an empty module specification.
62    */
 
63  417 toggle public SpecificationVo() {
64    // nothing to do
65    }
66   
 
67  399 toggle public final void setName(final String name) {
68  399 this.name = name;
69    }
70   
 
71  1771 toggle public final String getName() {
72  1771 return name;
73    }
74   
 
75  399 toggle public final void setRuleVersion(final String ruleVersion) {
76  399 this.ruleVersion = ruleVersion;
77    }
78   
 
79  1533 toggle public final String getRuleVersion() {
80  1533 return ruleVersion;
81    }
82   
83    /**
84    * Set list of locations for the module.
85    *
86    * @param locations List of locations for that module.
87    */
 
88  399 toggle public final void setLocationList(final LocationListVo locations) {
89  399 this.locationList = locations;
90    }
91   
 
92  4731 toggle public final LocationList getLocationList() {
93  4731 return locationList;
94    }
95   
 
96  266 toggle public boolean equals(final Object obj) {
97  266 if (!(obj instanceof SpecificationVo)) {
98  11 return false;
99    }
100  255 final SpecificationVo other = (SpecificationVo) obj;
101  255 return EqualsUtility.equals(getName(), other.getName())
102    && EqualsUtility.equals(getRuleVersion(), other.getRuleVersion())
103    && EqualsUtility.equals(getLocationList(), other.getLocationList());
104    }
105   
 
106  250 toggle public int hashCode() {
107  250 return (getName() != null ? getName().hashCode() : 0)
108  250 ^ (getRuleVersion() != null ? 1 ^ getRuleVersion().hashCode() : 0)
109  250 ^ (getLocationList() != null ? 1 ^ getLocationList().hashCode() : 0);
110    }
111   
 
112  136 toggle public String toString() {
113  136 return "Name: " + name + ", Rule Version: " + ruleVersion + "\n" + locationList;
114    }
115   
116    }