Package org.gbif.api.model.common.search
Class SearchResponse<T,P extends SearchParameter>
java.lang.Object
org.gbif.api.model.common.paging.PageableBase
org.gbif.api.model.common.paging.PagingResponse<T>
org.gbif.api.model.common.search.SearchResponse<T,P>
- Type Parameters:
T- the actual type of response content
- All Implemented Interfaces:
Pageable
Generic response of a search operation. The result is a
List of elements.
The type of the elements is bounded by the type parameter T. The list of results can be an empty list.
Optionally the response can contain: a count of the total returned elements, an offset, a pageSize and
the list of facets (if those were requested).-
Nested Class Summary
Nested classes/interfaces inherited from interface org.gbif.api.model.common.paging.Pageable
Pageable.OffsetLimitParameters -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.SearchResponse(long offset, int limit) Minimal paging constructor.Full constructor.SearchResponse(Pageable page) Minimal paging constructor.SearchResponse(PagingResponse<T> response) Minimal paging constructor. -
Method Summary
Modifier and TypeMethodDescriptionbooleanGets the resulting facets of a search operation, the list can be empty if no facets were requested.inthashCode()final voidSets the list of facets.voidsetSpellCheckResponse(SpellCheckResponse spellCheckResponse) Sets the spellcheck response.toString()Methods inherited from class org.gbif.api.model.common.paging.PagingResponse
getCount, getResults, isEndOfRecords, setCount, setEndOfRecords, setResultsMethods inherited from class org.gbif.api.model.common.paging.PageableBase
addOffset, copyPagingValues, getLimit, getOffset, setLimit, setOffset
-
Constructor Details
-
SearchResponse
public SearchResponse()Default constructor. -
SearchResponse
Minimal paging constructor. -
SearchResponse
Minimal paging constructor. -
SearchResponse
Minimal paging constructor. -
SearchResponse
public SearchResponse(long offset, int pageSize, Long count, List<T> results, List<Facet<P>> facets) Full constructor.- Parameters:
facets- list of facets, never null
-
-
Method Details
-
getFacets
Gets the resulting facets of a search operation, the list can be empty if no facets were requested. If there are no values for a facet, it will not be included in the list, i.e.: a facet should have at least 1 occurrence. -
setFacets
Sets the list of facets.- Parameters:
facets- list of facets, never null
-
getSpellCheckResponse
- Returns:
- the spellcheck response if it was requested
-
setSpellCheckResponse
Sets the spellcheck response.- Parameters:
spellCheckResponse- if it was requested
-
equals
- Overrides:
equalsin classPagingResponse<T>
-
hashCode
- Overrides:
hashCodein classPagingResponse<T>
-
toString
- Overrides:
toStringin classPagingResponse<T>
-