| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
| 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) |
|
|
|
| 17.1% |
Uncovered Elements: 97 (117) |
Complexity: 45 |
Complexity Density: 0.9 |
|
| 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 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 36 |
7
|
public SearchRequest() {... |
| 37 |
7
|
super(); |
| 38 |
|
} |
| 39 |
|
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 40 |
0
|
public SearchRequest(String searchKey){... |
| 41 |
0
|
this(); |
| 42 |
0
|
this.searchKey = searchKey; |
| 43 |
|
} |
| 44 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 45 |
0
|
public void addParam(String key, String value){... |
| 46 |
0
|
getParams().add(new SearchParam(key, value)); |
| 47 |
|
} |
| 48 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 49 |
0
|
public void addParam(String key, List<String> value){... |
| 50 |
0
|
getParams().add(new SearchParam(key, value)); |
| 51 |
|
} |
| 52 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 53 |
13
|
public String getSearchKey() {... |
| 54 |
13
|
return searchKey; |
| 55 |
|
} |
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 56 |
7
|
public void setSearchKey(String searchKey) {... |
| 57 |
7
|
this.searchKey = searchKey; |
| 58 |
|
} |
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
| 59 |
0
|
public List<SearchParam> getParams() {... |
| 60 |
0
|
if(params == null){ |
| 61 |
0
|
params = new ArrayList<SearchParam>(); |
| 62 |
|
} |
| 63 |
0
|
return params; |
| 64 |
|
} |
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 65 |
6
|
public void setParams(List<SearchParam> params) {... |
| 66 |
6
|
this.params = params; |
| 67 |
|
} |
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 68 |
1
|
public String getSortColumn() {... |
| 69 |
1
|
return sortColumn; |
| 70 |
|
} |
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 71 |
0
|
public void setSortColumn(String sortColumn) {... |
| 72 |
0
|
this.sortColumn = sortColumn; |
| 73 |
|
} |
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 74 |
1
|
public SortDirection getSortDirection() {... |
| 75 |
1
|
return sortDirection; |
| 76 |
|
} |
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 77 |
0
|
public void setSortDirection(SortDirection sortDirection) {... |
| 78 |
0
|
this.sortDirection = sortDirection; |
| 79 |
|
} |
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 80 |
0
|
public Integer getStartAt() {... |
| 81 |
0
|
return startAt; |
| 82 |
|
} |
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 83 |
4
|
public void setStartAt(Integer startAt) {... |
| 84 |
4
|
this.startAt = startAt; |
| 85 |
|
} |
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 86 |
1
|
public Integer getMaxResults() {... |
| 87 |
1
|
return maxResults; |
| 88 |
|
} |
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 89 |
4
|
public void setMaxResults(Integer maxResults) {... |
| 90 |
4
|
this.maxResults = maxResults; |
| 91 |
|
} |
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 92 |
0
|
public Boolean getNeededTotalResults() {... |
| 93 |
0
|
return neededTotalResults; |
| 94 |
|
} |
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 95 |
4
|
public void setNeededTotalResults(Boolean neededTotalResults) {... |
| 96 |
4
|
this.neededTotalResults = neededTotalResults; |
| 97 |
|
} |
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 98 |
0
|
@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 |
|
|
|
|
|
| 0% |
Uncovered Elements: 50 (50) |
Complexity: 17 |
Complexity Density: 0.85 |
|
| 107 |
0
|
@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 |
|
|
|
|
|
| 0% |
Uncovered Elements: 22 (22) |
Complexity: 8 |
Complexity Density: 1 |
|
| 126 |
0
|
@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 |
|
} |