| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 15 |
|
|
| 16 |
|
|
| 17 |
|
|
| 18 |
|
|
| 19 |
|
|
| 20 |
|
|
| 21 |
|
|
| 22 |
|
package jalview.fts.core; |
| 23 |
|
|
| 24 |
|
import jalview.bin.Cache; |
| 25 |
|
import jalview.datamodel.SequenceI; |
| 26 |
|
import jalview.fts.api.FTSDataColumnI; |
| 27 |
|
|
| 28 |
|
import java.util.Collection; |
| 29 |
|
|
| 30 |
|
|
| 31 |
|
|
| 32 |
|
|
| 33 |
|
@author |
| 34 |
|
|
| 35 |
|
|
| |
|
| 82.3% |
Uncovered Elements: 11 (62) |
Complexity: 28 |
Complexity Density: 0.88 |
|
| 36 |
|
public class FTSRestRequest |
| 37 |
|
{ |
| 38 |
|
private String fieldToSearchBy; |
| 39 |
|
|
| 40 |
|
private String searchTerm; |
| 41 |
|
|
| 42 |
|
private String fieldToSortBy; |
| 43 |
|
|
| 44 |
|
private SequenceI associatedSequence; |
| 45 |
|
|
| 46 |
|
private boolean allowEmptySequence; |
| 47 |
|
|
| 48 |
|
private boolean allowUnpublishedEntries = Cache |
| 49 |
|
.getDefault("ALLOW_UNPUBLISHED_PDB_QUERYING", false); |
| 50 |
|
|
| 51 |
|
private boolean facet; |
| 52 |
|
|
| 53 |
|
private String facetPivot; |
| 54 |
|
|
| 55 |
|
private int facetPivotMinCount; |
| 56 |
|
|
| 57 |
|
private int responseSize; |
| 58 |
|
|
| 59 |
|
private int offSet; |
| 60 |
|
|
| 61 |
|
private boolean isSortAscending; |
| 62 |
|
|
| 63 |
|
private Collection<FTSDataColumnI> wantedFields; |
| 64 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 65 |
35 |
public String getFieldToSearchBy()... |
| 66 |
|
{ |
| 67 |
35 |
return fieldToSearchBy; |
| 68 |
|
} |
| 69 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 70 |
35 |
public void setFieldToSearchBy(String fieldToSearchBy)... |
| 71 |
|
{ |
| 72 |
35 |
this.fieldToSearchBy = fieldToSearchBy; |
| 73 |
|
} |
| 74 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 75 |
48 |
public String getSearchTerm()... |
| 76 |
|
{ |
| 77 |
48 |
return searchTerm; |
| 78 |
|
} |
| 79 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 80 |
48 |
public void setSearchTerm(String searchTerm)... |
| 81 |
|
{ |
| 82 |
48 |
this.searchTerm = searchTerm; |
| 83 |
|
} |
| 84 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 85 |
34 |
public boolean isAllowEmptySeq()... |
| 86 |
|
{ |
| 87 |
34 |
return allowEmptySequence; |
| 88 |
|
} |
| 89 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 90 |
46 |
public void setAllowEmptySeq(boolean allowEmptySeq)... |
| 91 |
|
{ |
| 92 |
46 |
this.allowEmptySequence = allowEmptySeq; |
| 93 |
|
} |
| 94 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 95 |
68 |
public int getResponseSize()... |
| 96 |
|
{ |
| 97 |
68 |
return responseSize; |
| 98 |
|
} |
| 99 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 100 |
47 |
public void setResponseSize(int responseSize)... |
| 101 |
|
{ |
| 102 |
47 |
this.responseSize = responseSize; |
| 103 |
|
} |
| 104 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 105 |
13379 |
public Collection<FTSDataColumnI> getWantedFields()... |
| 106 |
|
{ |
| 107 |
13379 |
return wantedFields; |
| 108 |
|
} |
| 109 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 110 |
47 |
public void setWantedFields(Collection<FTSDataColumnI> wantedFields)... |
| 111 |
|
{ |
| 112 |
47 |
this.wantedFields = wantedFields; |
| 113 |
|
} |
| 114 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 115 |
40 |
public String getFieldToSortBy()... |
| 116 |
|
{ |
| 117 |
40 |
return fieldToSortBy; |
| 118 |
|
} |
| 119 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 120 |
2 |
public void setFieldToSortBy(String fieldToSortBy,... |
| 121 |
|
boolean isSortAscending) |
| 122 |
|
{ |
| 123 |
2 |
this.fieldToSortBy = fieldToSortBy; |
| 124 |
2 |
this.isSortAscending = isSortAscending; |
| 125 |
|
} |
| 126 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 127 |
2 |
public boolean isAscending()... |
| 128 |
|
{ |
| 129 |
2 |
return isSortAscending; |
| 130 |
|
} |
| 131 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 132 |
13345 |
public SequenceI getAssociatedSequence()... |
| 133 |
|
{ |
| 134 |
13345 |
return associatedSequence; |
| 135 |
|
} |
| 136 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 137 |
14 |
public void setAssociatedSequence(SequenceI associatedSequence)... |
| 138 |
|
{ |
| 139 |
14 |
this.associatedSequence = associatedSequence; |
| 140 |
|
} |
| 141 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 142 |
34 |
public boolean isAllowUnpublishedEntries()... |
| 143 |
|
{ |
| 144 |
34 |
return allowUnpublishedEntries; |
| 145 |
|
} |
| 146 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 147 |
0 |
public void setAllowUnpublishedEntries(boolean allowUnpublishedEntries)... |
| 148 |
|
{ |
| 149 |
0 |
this.allowUnpublishedEntries = allowUnpublishedEntries; |
| 150 |
|
} |
| 151 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 152 |
34 |
public boolean isFacet()... |
| 153 |
|
{ |
| 154 |
34 |
return facet; |
| 155 |
|
} |
| 156 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 157 |
0 |
public void setFacet(boolean facet)... |
| 158 |
|
{ |
| 159 |
0 |
this.facet = facet; |
| 160 |
|
} |
| 161 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 162 |
34 |
public String getFacetPivot()... |
| 163 |
|
{ |
| 164 |
34 |
return facetPivot; |
| 165 |
|
} |
| 166 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 167 |
0 |
public void setFacetPivot(String facetPivot)... |
| 168 |
|
{ |
| 169 |
0 |
this.facetPivot = facetPivot; |
| 170 |
|
} |
| 171 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 172 |
34 |
public int getFacetPivotMinCount()... |
| 173 |
|
{ |
| 174 |
34 |
return facetPivotMinCount; |
| 175 |
|
} |
| 176 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 177 |
0 |
public void setFacetPivotMinCount(int facetPivotMinCount)... |
| 178 |
|
{ |
| 179 |
0 |
this.facetPivotMinCount = facetPivotMinCount; |
| 180 |
|
} |
| 181 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 182 |
34 |
public int getOffSet()... |
| 183 |
|
{ |
| 184 |
34 |
return offSet; |
| 185 |
|
} |
| 186 |
|
|
| |
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 187 |
0 |
public void setOffSet(int offSet)... |
| 188 |
|
{ |
| 189 |
0 |
this.offSet = offSet; |
| 190 |
|
} |
| 191 |
|
|
| 192 |
|
|
| 193 |
|
|
| 194 |
|
|
| 195 |
|
@param |
| 196 |
|
|
| 197 |
|
@return |
| 198 |
|
|
| |
|
| 90% |
Uncovered Elements: 1 (10) |
Complexity: 3 |
Complexity Density: 0.5 |
|
| 199 |
178 |
public int getFieldIndex(String string)... |
| 200 |
|
{ |
| 201 |
178 |
int i = associatedSequence != null ? 1 : 0; |
| 202 |
178 |
for (FTSDataColumnI field : wantedFields) |
| 203 |
|
{ |
| 204 |
671 |
if (field.getName().equals(string)) |
| 205 |
|
{ |
| 206 |
178 |
return i; |
| 207 |
|
} |
| 208 |
493 |
i++; |
| 209 |
|
} |
| 210 |
0 |
return -1; |
| 211 |
|
} |
| 212 |
|
} |