2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2)
3 * Copyright (C) 2014 The Jalview Authors
5 * This file is part of Jalview.
7 * Jalview is free software: you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation, either version 3
10 * of the License, or (at your option) any later version.
12 * Jalview is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
19 * The Jalview Authors are detailed in the 'AUTHORS' file.
22 package jalview.ws.uimodel;
25 import jalview.ws.dbsources.PDBRestClient.PDBDocField;
27 import java.util.Collection;
30 * Represents the PDB request to be consumed by the PDBRestClient
35 public class PDBRestRequest
37 private String fieldToSearchBy;
39 private String searchTerm;
41 private String fieldToSortBy;
43 private String associatedSequence;
45 private boolean allowEmptySequence;
47 private int responseSize;
49 private boolean isSortAscending;
51 private Collection<PDBDocField> wantedFields;// = new
52 // Collection<PDBDocField>();
54 public String getFieldToSearchBy()
56 return fieldToSearchBy;
59 public void setFieldToSearchBy(String fieldToSearchBy)
61 this.fieldToSearchBy = fieldToSearchBy;
64 public String getSearchTerm()
69 public void setSearchTerm(String searchTerm)
71 this.searchTerm = searchTerm;
74 public boolean isAllowEmptySeq()
76 return allowEmptySequence;
79 public void setAllowEmptySeq(boolean allowEmptySeq)
81 this.allowEmptySequence = allowEmptySeq;
84 public int getResponseSize()
89 public void setResponseSize(int responseSize)
91 this.responseSize = responseSize;
94 public Collection<PDBDocField> getWantedFields()
99 public void setWantedFields(Collection<PDBDocField> wantedFields)
101 this.wantedFields = wantedFields;
104 public String getFieldToSortBy()
106 return fieldToSortBy;
109 public void setFieldToSortBy(String fieldToSortBy, boolean isSortAscending)
111 this.fieldToSortBy = fieldToSortBy;
112 this.isSortAscending = isSortAscending;
115 public boolean isAscending()
117 return isSortAscending;
120 public String getAssociatedSequence()
122 return associatedSequence;
125 public void setAssociatedSequence(String associatedSequence)
127 this.associatedSequence = associatedSequence;
130 public String getQuery()
132 return fieldToSearchBy + searchTerm
133 + (isAllowEmptySeq() ? "" : " AND molecule_sequence:['' TO *]");
136 public String toString()
138 return "Query : " + getQuery() + " sort field: " + fieldToSortBy
139 + " isAsc: " + isAscending() + " Associated Seq : "
140 + associatedSequence;