52c48a16e5d0f62a537b0e5d07f5176c08d12edc
[jalview.git] / src / jalview / fts / core / FTSRestRequest.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3  * Copyright (C) $$Year-Rel$$ The Jalview Authors
4  * 
5  * This file is part of Jalview.
6  * 
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.
11  *  
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.
16  * 
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.
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 import jalview.gui.Preferences;
28
29 import java.util.Collection;
30
31 /**
32  * Represents the FTS request to be consumed by the FTSRestClient
33  * 
34  * @author tcnofoegbu
35  *
36  */
37 public class FTSRestRequest
38 {
39   private String fieldToSearchBy;
40
41   private String searchTerm;
42
43   private String fieldToSortBy;
44
45   private SequenceI associatedSequence;
46
47   private boolean allowEmptySequence;
48
49   private boolean allowUnpublishedEntries = Cache
50           .getDefault(Preferences.ALLOW_UNPUBLISHED_PDB_QUERYING, false);
51
52   private boolean facet;
53
54   private String facetPivot;
55
56   private int facetPivotMinCount;
57
58   private int responseSize;
59
60   private int offSet;
61
62   private boolean isSortAscending;
63
64   private Collection<FTSDataColumnI> wantedFields;
65
66   public String getFieldToSearchBy()
67   {
68     return fieldToSearchBy;
69   }
70
71   public void setFieldToSearchBy(String fieldToSearchBy)
72   {
73     this.fieldToSearchBy = fieldToSearchBy;
74   }
75
76   public String getSearchTerm()
77   {
78     return searchTerm;
79   }
80
81   public void setSearchTerm(String searchTerm)
82   {
83     this.searchTerm = searchTerm;
84   }
85
86   public boolean isAllowEmptySeq()
87   {
88     return allowEmptySequence;
89   }
90
91   public void setAllowEmptySeq(boolean allowEmptySeq)
92   {
93     this.allowEmptySequence = allowEmptySeq;
94   }
95
96   public int getResponseSize()
97   {
98     return responseSize;
99   }
100
101   public void setResponseSize(int responseSize)
102   {
103     this.responseSize = responseSize;
104   }
105
106   public Collection<FTSDataColumnI> getWantedFields()
107   {
108     return wantedFields;
109   }
110
111   public void setWantedFields(Collection<FTSDataColumnI> wantedFields)
112   {
113     this.wantedFields = wantedFields;
114   }
115
116   public String getFieldToSortBy()
117   {
118     return fieldToSortBy;
119   }
120
121   public void setFieldToSortBy(String fieldToSortBy,
122           boolean isSortAscending)
123   {
124     this.fieldToSortBy = fieldToSortBy;
125     this.isSortAscending = isSortAscending;
126   }
127
128   public boolean isAscending()
129   {
130     return isSortAscending;
131   }
132
133   public SequenceI getAssociatedSequence()
134   {
135     return associatedSequence;
136   }
137
138   public void setAssociatedSequence(SequenceI associatedSequence)
139   {
140     this.associatedSequence = associatedSequence;
141   }
142
143   public boolean isAllowUnpublishedEntries()
144   {
145     return allowUnpublishedEntries;
146   }
147
148   public void setAllowUnpublishedEntries(boolean allowUnpublishedEntries)
149   {
150     this.allowUnpublishedEntries = allowUnpublishedEntries;
151   }
152
153   public boolean isFacet()
154   {
155     return facet;
156   }
157
158   public void setFacet(boolean facet)
159   {
160     this.facet = facet;
161   }
162
163   public String getFacetPivot()
164   {
165     return facetPivot;
166   }
167
168   public void setFacetPivot(String facetPivot)
169   {
170     this.facetPivot = facetPivot;
171   }
172
173   public int getFacetPivotMinCount()
174   {
175     return facetPivotMinCount;
176   }
177
178   public void setFacetPivotMinCount(int facetPivotMinCount)
179   {
180     this.facetPivotMinCount = facetPivotMinCount;
181   }
182
183   public int getOffSet()
184   {
185     return offSet;
186   }
187
188   public void setOffSet(int offSet)
189   {
190     this.offSet = offSet;
191   }
192 }