Package org.gbif.api.model.common.paging
Class PagingResponse<T>
java.lang.Object
org.gbif.api.model.common.paging.PageableBase
org.gbif.api.model.common.paging.PagingResponse<T>
- All Implemented Interfaces:
Pageable
- Direct Known Subclasses:
FacetedSearchResponse
,SearchResponse
Paging response bean.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.gbif.api.model.common.paging.Pageable
Pageable.OffsetLimitParameters
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor with default paging values.PagingResponse
(long offset, int limit) PagingResponse
(long offset, int limit, Long count) PagingResponse
(long offset, int limit, Long count, List<T> results) PagingResponse
(Pageable page) PagingResponse
(Pageable page, Long count) PagingResponse
(Pageable page, Long count, List<T> results) -
Method Summary
Modifier and TypeMethodDescriptionboolean
getCount()
Gets the count of total results of search operation.Gets the list of results.int
hashCode()
boolean
Flag indicating whether more records do exist.void
Sets the total count for all results, not only the ones in this response page.void
setEndOfRecords
(boolean endOfRecords) Manually sets the end of records flag.void
setResults
(List<T> results) Sets the list of results for the response.toString()
Methods inherited from class org.gbif.api.model.common.paging.PageableBase
addOffset, copyPagingValues, getLimit, getOffset, setLimit, setOffset
-
Constructor Details
-
PagingResponse
public PagingResponse()Default constructor with default paging values. -
PagingResponse
-
PagingResponse
-
PagingResponse
-
PagingResponse
-
PagingResponse
-
PagingResponse
-
-
Method Details
-
getCount
Gets the count of total results of search operation. -
setCount
Sets the total count for all results, not only the ones in this response page. The method will not set endOfRecords automatically. -
getResults
Gets the list of results. The type of element of the result are defined by the parameter class type T.- Returns:
- the results list.
-
setResults
Sets the list of results for the response. This method will not modify the endOfRecords flag. -
isEndOfRecords
Flag indicating whether more records do exist. If the property has never been manually initialised, the flag is determined automatically. If the total count is set it is used to determine the return value. If only the result is given, we consider a result size equal to limit as an indication that there are (potentially at least) more results.- Returns:
- true if all records have been returned otherwise null.
-
setEndOfRecords
Manually sets the end of records flag. Setting the flag to true or false deactivates the automatic calculation in #isEndOfRecords(). -
equals
- Overrides:
equals
in classPageableBase
-
hashCode
- Overrides:
hashCode
in classPageableBase
-
toString
- Overrides:
toString
in classPageableBase
-