Clover Coverage Report - KS Contract Documentation Generator 0.0.1-SNAPSHOT
Coverage timestamp: Wed Dec 31 1969 19:00:00 EST
../../../../../../../img/srcFileCovDistChart0.png 0% of files have more coverage
19   125   13   1.58
2   77   0.68   6
12     1.08  
2    
 
  SearchParamInfo       Line # 45 10 0% 5 16 0% 0.0
  SearchParamInfo.Builder       Line # 83 9 0% 8 17 0% 0.0
 
No Tests
 
1    /**
2    * Copyright 2011 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the
5    * "License"); you may not use this file except in compliance with the
6    * License. You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl1.php
9    *
10    * Unless required by applicable law or agreed to in writing, software
11    * distributed under the License is distributed on an "AS IS" BASIS,
12    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
13    * implied. See the License for the specific language governing
14    * permissions and limitations under the License.
15    */
16   
17    package org.kuali.student.contract.model.test.source;
18   
19    import java.io.Serializable;
20    import java.util.ArrayList;
21    import java.util.Arrays;
22    import java.util.List;
23   
24    import javax.xml.bind.annotation.XmlAccessType;
25    import javax.xml.bind.annotation.XmlAccessorType;
26    import javax.xml.bind.annotation.XmlAnyElement;
27    import javax.xml.bind.annotation.XmlAttribute;
28    import javax.xml.bind.annotation.XmlElement;
29    import javax.xml.bind.annotation.XmlElementWrapper;
30    import javax.xml.bind.annotation.XmlType;
31   
32    import org.kuali.student.contract.model.test.source.ModelBuilder;
33    import org.kuali.student.contract.model.test.source.SearchParam;
34    import org.w3c.dom.Element;
35   
36    /**
37    * Search Parameter
38    *
39    * A structure that holds a key value pair to supply a value to a parameter for searching.
40    *
41    * @author nwright
42    */
43    @XmlAccessorType(XmlAccessType.FIELD)
44    @XmlType(name = "SearchParamInfo", propOrder = {"key", "values", "_futureElements"})
 
45    public class SearchParamInfo implements SearchParam, Serializable {
46   
47    private static final long serialVersionUID = 1L;
48    @XmlAttribute
49    private final String key;
50    @XmlElementWrapper(name="values")
51    @XmlElement(name="value")
52    private final List<String> values;
53    @XmlAnyElement
54    private final List<Element> _futureElements;
55   
56   
 
57  0 toggle public SearchParamInfo() {
58  0 this.key = null;
59  0 this.values = null;
60  0 this._futureElements = null;
61    }
62   
 
63  0 toggle public SearchParamInfo(SearchParam infc) {
64  0 this.key = infc.getKey();
65  0 if (this.values == null) {
66  0 this.values = null;
67    } else {
68  0 this.values = new ArrayList(infc.getValues());
69    }
70  0 this._futureElements = null;
71    }
72   
 
73  0 toggle @Override
74    public List<String> getValues() {
75  0 return values;
76    }
77   
 
78  0 toggle @Override
79    public String getKey() {
80  0 return key;
81    }
82   
 
83    public static class Builder implements ModelBuilder<SearchParamInfo>, SearchParam {
84   
85    private String key;
86    private List<String> values;
87   
 
88  0 toggle public Builder() {}
89   
 
90  0 toggle public Builder(SearchParam searchInfo) {
91  0 this.key = searchInfo.getKey();
92  0 this.values = searchInfo.getValues();
93    }
94   
 
95  0 toggle public SearchParamInfo build () {
96  0 return new SearchParamInfo (this);
97    }
98   
 
99  0 toggle public String getKey() {
100  0 return key;
101    }
102   
 
103  0 toggle public void setKey(String key) {
104  0 this.key = key;
105    }
106   
 
107  0 toggle public List<String> getValues() {
108  0 return values;
109    }
110   
 
111  0 toggle public void setValues(List<String> values) {
112  0 this.values = values;
113    }
114   
115    /**
116    * Convenience method for setting a single value
117    * Actually stores it as a list with one value.
118    * @param value
119    */
 
120  0 toggle public Builder value(String value) {
121  0 this.values = Arrays.asList(value);
122  0 return this;
123    }
124    }
125    }