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
public class SearchResponse<T,P extends SearchParameter> extends PagingResponse<T>
Generic response of a search operation. The result is aList
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
Constructors Constructor Description SearchResponse()
Default constructor.SearchResponse(long offset, int limit)
Minimal paging constructor.SearchResponse(long offset, int pageSize, Long count, List<T> results, List<Facet<P>> facets)
Full constructor.SearchResponse(Pageable page)
Minimal paging constructor.SearchResponse(PagingResponse<T> response)
Minimal paging constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
List<Facet<P>>
getFacets()
Gets the resulting facets of a search operation, the list can be empty if no facets were requested.SpellCheckResponse
getSpellCheckResponse()
int
hashCode()
void
setFacets(List<Facet<P>> facets)
Sets the list of facets.void
setSpellCheckResponse(SpellCheckResponse spellCheckResponse)
Sets the spellcheck response.String
toString()
-
Methods inherited from class org.gbif.api.model.common.paging.PagingResponse
getCount, getResults, isEndOfRecords, setCount, setEndOfRecords, setResults
-
Methods inherited from class org.gbif.api.model.common.paging.PageableBase
addOffset, copyPagingValues, getLimit, getOffset, setLimit, setOffset
-
-
-
-
Constructor Detail
-
SearchResponse
public SearchResponse()
Default constructor.
-
SearchResponse
public SearchResponse(Pageable page)
Minimal paging constructor.
-
SearchResponse
public SearchResponse(PagingResponse<T> response)
Minimal paging constructor.
-
SearchResponse
public SearchResponse(long offset, int limit)
Minimal paging constructor.
-
-
Method Detail
-
getFacets
public List<Facet<P>> 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
public final void setFacets(List<Facet<P>> facets)
Sets the list of facets.- Parameters:
facets
- list of facets, never null
-
getSpellCheckResponse
public SpellCheckResponse getSpellCheckResponse()
- Returns:
- the spellcheck response if it was requested
-
setSpellCheckResponse
public void setSpellCheckResponse(SpellCheckResponse spellCheckResponse)
Sets the spellcheck response.- Parameters:
spellCheckResponse
- if it was requested
-
equals
public boolean equals(Object o)
- Overrides:
equals
in classPagingResponse<T>
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classPagingResponse<T>
-
toString
public String toString()
- Overrides:
toString
in classPagingResponse<T>
-
-