001/*
002 * Copyright 2020 Global Biodiversity Information Facility (GBIF)
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *     http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package org.gbif.api.model.collections.request;
017
018import org.gbif.api.model.common.paging.Pageable;
019import org.gbif.api.model.common.paging.PageableBase;
020import org.gbif.api.model.common.paging.PagingRequest;
021import org.gbif.api.vocabulary.CollectionsSortField;
022import org.gbif.api.vocabulary.Country;
023import org.gbif.api.vocabulary.GbifRegion;
024import org.gbif.api.vocabulary.IdentifierType;
025import org.gbif.api.vocabulary.SortOrder;
026import org.gbif.api.vocabulary.collections.MasterSourceType;
027
028import java.io.Serializable;
029import java.util.List;
030import java.util.UUID;
031
032import javax.annotation.Nullable;
033
034public abstract class SearchRequest extends PageableBase implements Serializable {
035
036  @Nullable private String q;
037  @Nullable private String code;
038  @Nullable private String name;
039  @Nullable private String alternativeCode;
040  @Nullable private UUID contact;
041  @Nullable private String machineTagNamespace;
042  @Nullable private String machineTagName;
043  @Nullable private String machineTagValue;
044  @Nullable private IdentifierType identifierType;
045  @Nullable private String identifier;
046  @Nullable private List<Country> country;
047  @Nullable private List<GbifRegion> gbifRegion;
048  @Nullable private String city;
049  @Nullable private String fuzzyName;
050  @Nullable private Boolean active;
051  @Nullable private MasterSourceType masterSourceType;
052  @Nullable private String numberSpecimens;
053  @Nullable private Boolean displayOnNHCPortal;
054  @Nullable private UUID replacedBy;
055  @Nullable private String occurrenceCount;
056  @Nullable private String typeSpecimenCount;
057  @Nullable private CollectionsSortField sortBy;
058  @Nullable private SortOrder sortOrder;
059  @Nullable private List<UUID> institutionKeys;
060
061  @Nullable
062  public String getQ() {
063    return q;
064  }
065
066  public void setQ(@Nullable String q) {
067    this.q = q;
068  }
069
070  @Nullable
071  public String getCode() {
072    return code;
073  }
074
075  public void setCode(@Nullable String code) {
076    this.code = code;
077  }
078
079  @Nullable
080  public String getName() {
081    return name;
082  }
083
084  public void setName(@Nullable String name) {
085    this.name = name;
086  }
087
088  @Nullable
089  public String getAlternativeCode() {
090    return alternativeCode;
091  }
092
093  public void setAlternativeCode(@Nullable String alternativeCode) {
094    this.alternativeCode = alternativeCode;
095  }
096
097  @Nullable
098  public UUID getContact() {
099    return contact;
100  }
101
102  public void setContact(@Nullable UUID contact) {
103    this.contact = contact;
104  }
105
106  @Nullable
107  public String getMachineTagNamespace() {
108    return machineTagNamespace;
109  }
110
111  public void setMachineTagNamespace(@Nullable String machineTagNamespace) {
112    this.machineTagNamespace = machineTagNamespace;
113  }
114
115  @Nullable
116  public String getMachineTagName() {
117    return machineTagName;
118  }
119
120  public void setMachineTagName(@Nullable String machineTagName) {
121    this.machineTagName = machineTagName;
122  }
123
124  @Nullable
125  public String getMachineTagValue() {
126    return machineTagValue;
127  }
128
129  public void setMachineTagValue(@Nullable String machineTagValue) {
130    this.machineTagValue = machineTagValue;
131  }
132
133  @Nullable
134  public IdentifierType getIdentifierType() {
135    return identifierType;
136  }
137
138  public void setIdentifierType(@Nullable IdentifierType identifierType) {
139    this.identifierType = identifierType;
140  }
141
142  @Nullable
143  public String getIdentifier() {
144    return identifier;
145  }
146
147  public void setIdentifier(@Nullable String identifier) {
148    this.identifier = identifier;
149  }
150
151  @Nullable
152  public List<Country> getCountry() {
153    return country;
154  }
155
156  public void setCountry(@Nullable List<Country> country) {
157    this.country = country;
158  }
159
160  @Nullable
161  public String getCity() {
162    return city;
163  }
164
165  public void setCity(@Nullable String city) {
166    this.city = city;
167  }
168
169  @Nullable
170  public String getFuzzyName() {
171    return fuzzyName;
172  }
173
174  public void setFuzzyName(@Nullable String fuzzyName) {
175    this.fuzzyName = fuzzyName;
176  }
177
178  @Nullable
179  public Boolean getActive() {
180    return active;
181  }
182
183  public void setActive(@Nullable Boolean active) {
184    this.active = active;
185  }
186
187  @Nullable
188  public MasterSourceType getMasterSourceType() {
189    return masterSourceType;
190  }
191
192  public void setMasterSourceType(@Nullable MasterSourceType masterSourceType) {
193    this.masterSourceType = masterSourceType;
194  }
195
196  @Nullable
197  public String getNumberSpecimens() {
198    return numberSpecimens;
199  }
200
201  public void setNumberSpecimens(@Nullable String numberSpecimens) {
202    this.numberSpecimens = numberSpecimens;
203  }
204
205  public Boolean getDisplayOnNHCPortal() {
206    return displayOnNHCPortal;
207  }
208
209  public void setDisplayOnNHCPortal(Boolean displayOnNHCPortal) {
210    this.displayOnNHCPortal = displayOnNHCPortal;
211  }
212
213  public Pageable getPage() {
214    return new PagingRequest(getOffset(), getLimit());
215  }
216
217  @Nullable
218  public UUID getReplacedBy() {
219    return replacedBy;
220  }
221
222  public void setReplacedBy(@Nullable UUID replacedBy) {
223    this.replacedBy = replacedBy;
224  }
225
226  @Nullable
227  public List<GbifRegion> getGbifRegion() {
228    return gbifRegion;
229  }
230
231  public void setGbifRegion(@Nullable List<GbifRegion> gbifRegion) {
232    this.gbifRegion = gbifRegion;
233  }
234
235  @Nullable
236  public String getOccurrenceCount() {
237    return occurrenceCount;
238  }
239
240  public void setOccurrenceCount(@Nullable String occurrenceCount) {
241    this.occurrenceCount = occurrenceCount;
242  }
243
244  @Nullable
245  public String getTypeSpecimenCount() {
246    return typeSpecimenCount;
247  }
248
249  public void setTypeSpecimenCount(@Nullable String typeSpecimenCount) {
250    this.typeSpecimenCount = typeSpecimenCount;
251  }
252
253  @Nullable
254  public CollectionsSortField getSortBy() {
255    return sortBy;
256  }
257
258  public void setSortBy(@Nullable CollectionsSortField sortBy) {
259    this.sortBy = sortBy;
260  }
261
262  @Nullable
263  public SortOrder getSortOrder() {
264    return sortOrder;
265  }
266
267  public void setSortOrder(@Nullable SortOrder sortOrder) {
268    this.sortOrder = sortOrder;
269  }
270
271  @Nullable
272  public List<UUID> getInstitutionKeys() {
273    return institutionKeys;
274  }
275
276  public void setInstitutionKeys(@Nullable List<UUID> institutionKeys) {
277    this.institutionKeys = institutionKeys;
278  }
279}