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.datamodel.SequenceI;
26 import jalview.ws.dbsources.PDBRestClient.PDBDocField;
28 import java.util.Collection;
31 * Represents the PDB request to be consumed by the PDBRestClient
36 public class PDBRestRequest
38 private String fieldToSearchBy;
40 private String searchTerm;
42 private String fieldToSortBy;
44 private SequenceI associatedSequence;
46 private boolean allowEmptySequence;
48 private int responseSize;
50 private boolean isSortAscending;
52 private Collection<PDBDocField> wantedFields;// = new
53 // Collection<PDBDocField>();
55 public String getFieldToSearchBy()
57 return fieldToSearchBy;
60 public void setFieldToSearchBy(String fieldToSearchBy)
62 this.fieldToSearchBy = fieldToSearchBy;
65 public String getSearchTerm()
70 public void setSearchTerm(String searchTerm)
72 this.searchTerm = searchTerm;
75 public boolean isAllowEmptySeq()
77 return allowEmptySequence;
80 public void setAllowEmptySeq(boolean allowEmptySeq)
82 this.allowEmptySequence = allowEmptySeq;
85 public int getResponseSize()
90 public void setResponseSize(int responseSize)
92 this.responseSize = responseSize;
95 public Collection<PDBDocField> getWantedFields()
100 public void setWantedFields(Collection<PDBDocField> wantedFields)
102 this.wantedFields = wantedFields;
105 public String getFieldToSortBy()
107 return fieldToSortBy;
110 public void setFieldToSortBy(String fieldToSortBy, boolean isSortAscending)
112 this.fieldToSortBy = fieldToSortBy;
113 this.isSortAscending = isSortAscending;
116 public boolean isAscending()
118 return isSortAscending;
121 public SequenceI getAssociatedSequence()
123 return associatedSequence;
126 public void setAssociatedSequence(SequenceI associatedSequence)
128 this.associatedSequence = associatedSequence;
131 public String getQuery()
133 return fieldToSearchBy + searchTerm
134 + (isAllowEmptySeq() ? "" : " AND molecule_sequence:['' TO *]");
137 public String toString()
139 return "Query : " + getQuery() + " sort field: " + fieldToSortBy
140 + " isAsc: " + isAscending() + " Associated Seq : "
141 + associatedSequence;