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
public class PagingResponse<T> extends PageableBase
Paging response bean.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.gbif.api.model.common.paging.Pageable
Pageable.OffsetLimitParameters
-
-
Constructor Summary
Constructors Constructor Description PagingResponse()
Default 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
Long
getCount()
Gets the count of total results of search operation.List<T>
getResults()
Gets the list of results.int
hashCode()
boolean
isEndOfRecords()
Flag indicating whether more records do exist.void
setCount(Long count)
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.String
toString()
-
Methods inherited from class org.gbif.api.model.common.paging.PageableBase
addOffset, copyPagingValues, getLimit, getOffset, setLimit, setOffset
-
-
-
-
Constructor Detail
-
PagingResponse
public PagingResponse()
Default constructor with default paging values.
-
PagingResponse
public PagingResponse(Pageable page)
-
PagingResponse
public PagingResponse(Pageable page, Long count)
-
PagingResponse
public PagingResponse(long offset, int limit)
-
PagingResponse
public PagingResponse(Pageable page, Long count, List<T> results)
-
PagingResponse
public PagingResponse(long offset, int limit, Long count)
-
PagingResponse
public PagingResponse(long offset, int limit, Long count, List<T> results)
-
-
Method Detail
-
setCount
public void setCount(Long count)
Sets the total count for all results, not only the ones in this response page. The method will not set endOfRecords automatically.
-
getResults
public List<T> 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
public void setResults(List<T> results)
Sets the list of results for the response. This method will not modify the endOfRecords flag.
-
isEndOfRecords
public boolean 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
public void setEndOfRecords(boolean endOfRecords)
Manually sets the end of records flag. Setting the flag to true or false deactivates the automatic calculation in #isEndOfRecords().
-
equals
public boolean equals(Object o)
- Overrides:
equals
in classPageableBase
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classPageableBase
-
toString
public String toString()
- Overrides:
toString
in classPageableBase
-
-