Clover Coverage Report - KS Common Api 1.2
Coverage timestamp: Thu Jan 1 1970 00:00:00 UTC
../../../../../../img/srcFileCovDistChart0.png 0% of files have more coverage
50   137   45   2.38
46   109   0.9   21
21     2.14  
1    
 
  SearchRequest       Line # 26 50 0% 45 117 0% 0.0
 
No Tests
 
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.ArrayList;
20    import java.util.List;
21   
22    import javax.xml.bind.annotation.XmlAccessType;
23    import javax.xml.bind.annotation.XmlAccessorType;
24   
25    @XmlAccessorType(XmlAccessType.FIELD)
 
26    public class SearchRequest implements Serializable {
27    private static final long serialVersionUID = 1L;
28    private String searchKey;
29    private List<SearchParam> params;
30    private String sortColumn;
31    private SortDirection sortDirection;
32    private Integer startAt;
33    private Integer maxResults;
34    private Boolean neededTotalResults;
35   
 
36  0 toggle public SearchRequest() {
37  0 super();
38    }
39   
 
40  0 toggle public SearchRequest(String searchKey){
41  0 this();
42  0 this.searchKey = searchKey;
43    }
44   
 
45  0 toggle public void addParam(String key, String value){
46  0 getParams().add(new SearchParam(key, value));
47    }
48   
 
49  0 toggle public void addParam(String key, List<String> value){
50  0 getParams().add(new SearchParam(key, value));
51    }
52   
 
53  0 toggle public String getSearchKey() {
54  0 return searchKey;
55    }
 
56  0 toggle public void setSearchKey(String searchKey) {
57  0 this.searchKey = searchKey;
58    }
 
59  0 toggle public List<SearchParam> getParams() {
60  0 if(params == null){
61  0 params = new ArrayList<SearchParam>();
62    }
63  0 return params;
64    }
 
65  0 toggle public void setParams(List<SearchParam> params) {
66  0 this.params = params;
67    }
 
68  0 toggle public String getSortColumn() {
69  0 return sortColumn;
70    }
 
71  0 toggle public void setSortColumn(String sortColumn) {
72  0 this.sortColumn = sortColumn;
73    }
 
74  0 toggle public SortDirection getSortDirection() {
75  0 return sortDirection;
76    }
 
77  0 toggle public void setSortDirection(SortDirection sortDirection) {
78  0 this.sortDirection = sortDirection;
79    }
 
80  0 toggle public Integer getStartAt() {
81  0 return startAt;
82    }
 
83  0 toggle public void setStartAt(Integer startAt) {
84  0 this.startAt = startAt;
85    }
 
86  0 toggle public Integer getMaxResults() {
87  0 return maxResults;
88    }
 
89  0 toggle public void setMaxResults(Integer maxResults) {
90  0 this.maxResults = maxResults;
91    }
 
92  0 toggle public Boolean getNeededTotalResults() {
93  0 return neededTotalResults;
94    }
 
95  0 toggle public void setNeededTotalResults(Boolean neededTotalResults) {
96  0 this.neededTotalResults = neededTotalResults;
97    }
 
98  0 toggle @Override
99    public String toString() {
100  0 return "SearchRequest [searchKey=" + searchKey + ", params=" + params
101    + ", sortColumn=" + sortColumn + ", sortDirection="
102    + sortDirection + ", startAt=" + startAt + ", maxResults="
103    + maxResults + ", neededTotalResults=" + neededTotalResults
104    + "]";
105    }
106   
 
107  0 toggle @Override
108    public boolean equals(Object o) {
109  0 if (this == o) return true;
110  0 if (o == null || getClass() != o.getClass()) return false;
111   
112  0 SearchRequest that = (SearchRequest) o;
113   
114  0 if (maxResults != null ? !maxResults.equals(that.maxResults) : that.maxResults != null) return false;
115  0 if (neededTotalResults != null ? !neededTotalResults.equals(that.neededTotalResults) : that.neededTotalResults != null)
116  0 return false;
117  0 if (params != null ? !params.equals(that.params) : that.params != null) return false;
118  0 if (searchKey != null ? !searchKey.equals(that.searchKey) : that.searchKey != null) return false;
119  0 if (sortColumn != null ? !sortColumn.equals(that.sortColumn) : that.sortColumn != null) return false;
120  0 if (sortDirection != that.sortDirection) return false;
121  0 if (startAt != null ? !startAt.equals(that.startAt) : that.startAt != null) return false;
122   
123  0 return true;
124    }
125   
 
126  0 toggle @Override
127    public int hashCode() {
128  0 int result = searchKey != null ? searchKey.hashCode() : 0;
129  0 result = 31 * result + (params != null ? params.hashCode() : 0);
130  0 result = 31 * result + (sortColumn != null ? sortColumn.hashCode() : 0);
131  0 result = 31 * result + (sortDirection != null ? sortDirection.hashCode() : 0);
132  0 result = 31 * result + (startAt != null ? startAt.hashCode() : 0);
133  0 result = 31 * result + (maxResults != null ? maxResults.hashCode() : 0);
134  0 result = 31 * result + (neededTotalResults != null ? neededTotalResults.hashCode() : 0);
135  0 return result;
136    }
137    }