JAL-2071 further refactoring, optimisation, and house keeping for the generic Free...
[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
28 import java.util.Collection;
29
30 /**
31  * Represents the FTS request to be consumed by the FTSRestClient
32  * 
33  * @author tcnofoegbu
34  *
35  */
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.getDefault(
49           "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 boolean isSortAscending;
60
61   private Collection<FTSDataColumnI> wantedFields;
62
63   public String getFieldToSearchBy()
64   {
65     return fieldToSearchBy;
66   }
67
68   public void setFieldToSearchBy(String fieldToSearchBy)
69   {
70     this.fieldToSearchBy = fieldToSearchBy;
71   }
72
73   public String getSearchTerm()
74   {
75     return searchTerm;
76   }
77
78   public void setSearchTerm(String searchTerm)
79   {
80     this.searchTerm = searchTerm;
81   }
82
83   public boolean isAllowEmptySeq()
84   {
85     return allowEmptySequence;
86   }
87
88   public void setAllowEmptySeq(boolean allowEmptySeq)
89   {
90     this.allowEmptySequence = allowEmptySeq;
91   }
92
93   public int getResponseSize()
94   {
95     return responseSize;
96   }
97
98   public void setResponseSize(int responseSize)
99   {
100     this.responseSize = responseSize;
101   }
102
103   public Collection<FTSDataColumnI> getWantedFields()
104   {
105     return wantedFields;
106   }
107
108   public void setWantedFields(
109           Collection<FTSDataColumnI> wantedFields)
110   {
111     this.wantedFields = wantedFields;
112   }
113
114   public String getFieldToSortBy()
115   {
116     return fieldToSortBy;
117   }
118
119   public void setFieldToSortBy(String fieldToSortBy, boolean isSortAscending)
120   {
121     this.fieldToSortBy = fieldToSortBy;
122     this.isSortAscending = isSortAscending;
123   }
124
125   public boolean isAscending()
126   {
127     return isSortAscending;
128   }
129
130   public SequenceI getAssociatedSequence()
131   {
132     return associatedSequence;
133   }
134
135   public void setAssociatedSequence(SequenceI associatedSequence)
136   {
137     this.associatedSequence = associatedSequence;
138   }
139
140   public boolean isAllowUnpublishedEntries()
141   {
142     return allowUnpublishedEntries;
143   }
144
145   public void setAllowUnpublishedEntries(boolean allowUnpublishedEntries)
146   {
147     this.allowUnpublishedEntries = allowUnpublishedEntries;
148   }
149
150   public boolean isFacet()
151   {
152     return facet;
153   }
154
155   public void setFacet(boolean facet)
156   {
157     this.facet = facet;
158   }
159
160   public String getFacetPivot()
161   {
162     return facetPivot;
163   }
164
165   public void setFacetPivot(String facetPivot)
166   {
167     this.facetPivot = facetPivot;
168   }
169
170   public int getFacetPivotMinCount()
171   {
172     return facetPivotMinCount;
173   }
174
175   public void setFacetPivotMinCount(int facetPivotMinCount)
176   {
177     this.facetPivotMinCount = facetPivotMinCount;
178   }
179 }