T - the type of the underlying model, like category or product.public interface PagedQueryResult<T> extends PagedResult<T>
| Modifier and Type | Method and Description |
|---|---|
static <T> PagedQueryResultDsl<T> |
empty()
Creates a
PagedQueryResult for queries with no matching values. |
Long |
getCount()
The actual number of results returned.
|
Long |
getLimit()
The limit supplied by the client or the server default.
|
Long |
getOffset()
The offset supplied by the client or the server default.
|
List<T> |
getResults()
List of results.
|
Long |
getTotal()
The total number of results matching the request.
|
static <T> PagedQueryResultDsl<T> |
of(List<T> results)
Deprecated.
PagedQueryResult should remain as a read model, and be constructed only by deserialization.
|
static <T> PagedQueryResultDsl<T> |
of(Long offset,
Long total,
List<T> results)
Deprecated.
PagedQueryResult should remain as a read model, and be constructed only by deserialization.
|
static <T> PagedQueryResultDsl<T> |
of(Long offset,
Long limit,
Long total,
List<T> results)
Deprecated.
PagedQueryResult should remain as a read model, and be constructed only by deserialization.
|
static <T> PagedQueryResultDsl<T> |
of(T singleResult)
Deprecated.
PagedQueryResult should remain as a read model, and be constructed only by deserialization.
|
getPageIndex, getTotalPages, head, isFirst, isLast, sizestatic <T> PagedQueryResultDsl<T> empty()
PagedQueryResult for queries with no matching values.T - the type of the underlying modelPagedQueryResult@Deprecated static <T> PagedQueryResultDsl<T> of(Long offset, Long limit, Long total, List<T> results)
T - the type of the underlying modellimit - The limit supplied by the client or the server defaultoffset - The offset supplied by the client or the server default.total - The total number of results matching the request.results - the mocked results.@Deprecated static <T> PagedQueryResultDsl<T> of(Long offset, Long total, List<T> results)
T - the type of the underlying modeloffset - The offset supplied by the client or the server default.total - The total number of results matching the request.results - The mocked result.@Deprecated static <T> PagedQueryResultDsl<T> of(List<T> results)
T - the type of the underlying modelresults - The mocked result.static <T> PagedQueryResultDsl<T> of(T singleResult)
T - the type of the underlying modelsingleResult - the single result expected in the return.Long getCount()
getCount in interface PagedResult<T>Long getOffset()
getOffset in interface PagedResult<T>Long getLimit()
getLimit in interface PagedResult<T>List<T> getResults()
PagedResult.getCount() is not equal
to PagedResult.getTotal() the container contains only a subset of all
elements that match the request.getResults in interface PagedResult<T>PagedResult.getCount() elements matching the requestLong getTotal()
getTotal in interface PagedResult<T>