| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| SearchRequest | 
 | 
 | 2.9411764705882355;2.941 | 
| 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.core.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 | 0 |  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 |          public String getSearchKey() { | |
| 37 | 0 |                  return searchKey; | 
| 38 | } | |
| 39 | public void setSearchKey(String searchKey) { | |
| 40 | 0 |                  this.searchKey = searchKey; | 
| 41 | 0 |          } | 
| 42 |          public List<SearchParam> getParams() { | |
| 43 | 0 |                  if(params == null){ | 
| 44 | 0 |                          params = new ArrayList<SearchParam>(); | 
| 45 | } | |
| 46 | 0 |                  return params; | 
| 47 | } | |
| 48 | public void setParams(List<SearchParam> params) { | |
| 49 | 0 |                  this.params = params; | 
| 50 | 0 |          } | 
| 51 |          public String getSortColumn() { | |
| 52 | 0 |                  return sortColumn; | 
| 53 | } | |
| 54 | public void setSortColumn(String sortColumn) { | |
| 55 | 0 |                  this.sortColumn = sortColumn; | 
| 56 | 0 |          } | 
| 57 |          public SortDirection getSortDirection() { | |
| 58 | 0 |                  return sortDirection; | 
| 59 | } | |
| 60 | public void setSortDirection(SortDirection sortDirection) { | |
| 61 | 0 |                  this.sortDirection = sortDirection; | 
| 62 | 0 |          } | 
| 63 |          public Integer getStartAt() { | |
| 64 | 0 |                  return startAt; | 
| 65 | } | |
| 66 | public void setStartAt(Integer startAt) { | |
| 67 | 0 |                  this.startAt = startAt; | 
| 68 | 0 |          } | 
| 69 |          public Integer getMaxResults() { | |
| 70 | 0 |                  return maxResults; | 
| 71 | } | |
| 72 | public void setMaxResults(Integer maxResults) { | |
| 73 | 0 |                  this.maxResults = maxResults; | 
| 74 | 0 |          } | 
| 75 |          public Boolean getNeededTotalResults() { | |
| 76 | 0 |                  return neededTotalResults; | 
| 77 | } | |
| 78 | public void setNeededTotalResults(Boolean neededTotalResults) { | |
| 79 | 0 |                  this.neededTotalResults = neededTotalResults; | 
| 80 | 0 |          } | 
| 81 | @Override | |
| 82 |          public String toString() { | |
| 83 | 0 |                  return "SearchRequest [searchKey=" + searchKey + ", params=" + params | 
| 84 | + ", sortColumn=" + sortColumn + ", sortDirection=" | |
| 85 | + sortDirection + ", startAt=" + startAt + ", maxResults=" | |
| 86 |                                  + maxResults + ", neededTotalResults=" + neededTotalResults | |
| 87 |                                  + "]"; | |
| 88 | } | |
| 89 | ||
| 90 | @Override | |
| 91 | public boolean equals(Object o) { | |
| 92 | 0 |          if (this == o) return true; | 
| 93 | 0 |          if (o == null || getClass() != o.getClass()) return false; | 
| 94 | ||
| 95 | 0 |          SearchRequest that = (SearchRequest) o; | 
| 96 | ||
| 97 | 0 |          if (maxResults != null ? !maxResults.equals(that.maxResults) : that.maxResults != null) return false; | 
| 98 | 0 |          if (neededTotalResults != null ? !neededTotalResults.equals(that.neededTotalResults) : that.neededTotalResults != null) | 
| 99 | 0 |              return false; | 
| 100 | 0 |          if (params != null ? !params.equals(that.params) : that.params != null) return false; | 
| 101 | 0 |          if (searchKey != null ? !searchKey.equals(that.searchKey) : that.searchKey != null) return false; | 
| 102 | 0 |          if (sortColumn != null ? !sortColumn.equals(that.sortColumn) : that.sortColumn != null) return false; | 
| 103 | 0 |          if (sortDirection != that.sortDirection) return false; | 
| 104 | 0 |          if (startAt != null ? !startAt.equals(that.startAt) : that.startAt != null) return false; | 
| 105 | ||
| 106 | 0 |          return true; | 
| 107 | } | |
| 108 | ||
| 109 | @Override | |
| 110 | public int hashCode() { | |
| 111 | 0 |          int result = searchKey != null ? searchKey.hashCode() : 0; | 
| 112 | 0 |          result = 31 * result + (params != null ? params.hashCode() : 0); | 
| 113 | 0 |          result = 31 * result + (sortColumn != null ? sortColumn.hashCode() : 0); | 
| 114 | 0 |          result = 31 * result + (sortDirection != null ? sortDirection.hashCode() : 0); | 
| 115 | 0 |          result = 31 * result + (startAt != null ? startAt.hashCode() : 0); | 
| 116 | 0 |          result = 31 * result + (maxResults != null ? maxResults.hashCode() : 0); | 
| 117 | 0 |          result = 31 * result + (neededTotalResults != null ? neededTotalResults.hashCode() : 0); | 
| 118 | 0 |          return result; | 
| 119 | } | |
| 120 | } |