Clover Coverage Report
Coverage timestamp: Fri May 24 2013 13:47:27 UTC
../../../../../../img/srcFileCovDistChart10.png 0% of files have more coverage
15   113   15   1.36
8   52   1   11
11     1.36  
1    
 
  SpecificationVo       Line # 31 15 15 100% 1.0
 
  (105)
 
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.LocationList;
20    import org.qedeq.kernel.se.base.module.Specification;
21   
22   
23    /**
24    * Describes a specification of a module, that means its name, versions and possible
25    * "physical" locations.
26    * The combination of {@link #getName()} and {@link #getRuleVersion()} defines the
27    * file name of that module.
28    *
29    * @author Michael Meyling
30    */
 
31    public class SpecificationVo implements Specification {
32   
33    /** Module name. */
34    private String name;
35   
36    /** Rule version, that is needed to verify the module. */
37    private String ruleVersion;
38   
39    /** List of locations for the module. */
40    private LocationList locationList;
41   
42    /**
43    * Constructs a module specification. The combination of <code>name</code> and
44    * <code>ruleVersion</code> defines the file name of that module.
45    *
46    * @param name Module name.
47    * @param ruleVersion Rule version. This version is at least needed to verify that module.
48    * @param locations List of locations for that module.
49    */
 
50  1244 toggle public SpecificationVo(final String name, final String ruleVersion,
51    final LocationList locations) {
52  1244 this.name = name;
53  1244 this.ruleVersion = ruleVersion;
54  1244 this.locationList = locations;
55    }
56   
57    /**
58    * Constructs an empty module specification.
59    */
 
60  1354 toggle public SpecificationVo() {
61    // nothing to do
62    }
63   
 
64  1324 toggle public final void setName(final String name) {
65  1324 this.name = name;
66    }
67   
 
68  4782 toggle public final String getName() {
69  4782 return name;
70    }
71   
 
72  1324 toggle public final void setRuleVersion(final String ruleVersion) {
73  1324 this.ruleVersion = ruleVersion;
74    }
75   
 
76  5050 toggle public final String getRuleVersion() {
77  5050 return ruleVersion;
78    }
79   
80    /**
81    * Set list of locations for the module.
82    *
83    * @param locations List of locations for that module.
84    */
 
85  1330 toggle public final void setLocationList(final LocationListVo locations) {
86  1330 this.locationList = locations;
87    }
88   
 
89  11849 toggle public final LocationList getLocationList() {
90  11849 return locationList;
91    }
92   
 
93  283 toggle public boolean equals(final Object obj) {
94  283 if (!(obj instanceof SpecificationVo)) {
95  11 return false;
96    }
97  272 final SpecificationVo other = (SpecificationVo) obj;
98  272 return EqualsUtility.equals(getName(), other.getName())
99    && EqualsUtility.equals(getRuleVersion(), other.getRuleVersion())
100    && EqualsUtility.equals(getLocationList(), other.getLocationList());
101    }
102   
 
103  346 toggle public int hashCode() {
104  346 return (getName() != null ? getName().hashCode() : 0)
105  346 ^ (getRuleVersion() != null ? 1 ^ getRuleVersion().hashCode() : 0)
106  346 ^ (getLocationList() != null ? 1 ^ getLocationList().hashCode() : 0);
107    }
108   
 
109  214 toggle public String toString() {
110  214 return "Name: " + name + ", Rule Version: " + ruleVersion + "\n" + locationList;
111    }
112   
113    }