Clover Coverage Report - Kuali Student 1.2.1-SNAPSHOT (Aggregated)
Coverage timestamp: Wed Nov 2 2011 04:03:58 EST
../../../../../../img/srcFileCovDistChart1.png 41% of files have more coverage
33   106   24   3
24   73   0.73   11
11     2.18  
1    
 
  SearchParam       Line # 26 33 0% 24 61 10.3% 0.10294118
 
  (2)
 
1    /**
2    * Copyright 2010 The Kuali Foundation Licensed under the
3    * Educational Community License, Version 2.0 (the "License"); you may
4    * not use this file except in compliance with the License. You may
5    * obtain a copy of the License at
6    *
7    * http://www.osedu.org/licenses/ECL-2.0
8    *
9    * Unless required by applicable law or agreed to in writing,
10    * software distributed under the License is distributed on an "AS IS"
11    * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12    * or implied. See the License for the specific language governing
13    * permissions and limitations under the License.
14    */
15   
16    package org.kuali.student.common.search.dto;
17   
18    import java.io.Serializable;
19    import java.util.List;
20   
21    import javax.xml.bind.annotation.XmlAccessType;
22    import javax.xml.bind.annotation.XmlAccessorType;
23    import javax.xml.bind.annotation.XmlAttribute;
24    import javax.xml.bind.annotation.XmlElement;
25    @XmlAccessorType(XmlAccessType.FIELD)
 
26    public class SearchParam implements Serializable {
27   
28    private static final long serialVersionUID = 1L;
29    @XmlElement
30    private String value;
31    @XmlElement
32    private List<String> listValue;
33    @XmlAttribute
34    private String key;
35   
 
36  8 toggle public SearchParam(){
37  8 super();
38    }
39   
 
40  0 toggle public SearchParam(String key, String value) {
41  0 this();
42  0 this.key = key;
43  0 this.value = value;
44    }
45   
 
46  0 toggle public SearchParam(String key, List<String> value) {
47  0 this();
48  0 this.key = key;
49  0 this.listValue = value;
50    }
51   
52   
 
53  0 toggle public Object getValue() {
54  0 if (value != null) {
55  0 return value;
56    } else {
57  0 return listValue;
58    }
59    }
60   
 
61  8 toggle public void setValue(String value) {
62  8 this.value = value;
63  8 listValue = null;
64    }
65   
 
66  0 toggle public void setValue(List<String> listValue) {
67  0 this.listValue = listValue;
68  0 value = null;
69    }
70   
 
71  0 toggle public String getKey() {
72  0 return key;
73    }
74   
 
75  8 toggle public void setKey(String key) {
76  8 this.key = key;
77    }
78   
 
79  0 toggle @Override
80    public String toString() {
81  0 return "SearchParam[key=" + key + ", value=" + value + ", listValue="
82    + listValue + "]";
83    }
84   
 
85  0 toggle @Override
86    public boolean equals(Object o) {
87  0 if (this == o) return true;
88  0 if (o == null || getClass() != o.getClass()) return false;
89   
90  0 SearchParam that = (SearchParam) o;
91   
92  0 if (key != null ? !key.equals(that.key) : that.key != null) return false;
93  0 if (listValue != null ? !listValue.equals(that.listValue) : that.listValue != null) return false;
94  0 if (value != null ? !value.equals(that.value) : that.value != null) return false;
95   
96  0 return true;
97    }
98   
 
99  0 toggle @Override
100    public int hashCode() {
101  0 int result = value != null ? value.hashCode() : 0;
102  0 result = 31 * result + (listValue != null ? listValue.hashCode() : 0);
103  0 result = 31 * result + (key != null ? key.hashCode() : 0);
104  0 return result;
105    }
106    }