T
- the type of record that is being searched.public class PaginatedSearchResult<T> extends SearchResult<T>
It enables to have the offset for the next page, previous page, last page and first page.
Note: The offset calculation is not based on the results count
Modifier and Type | Field and Description |
---|---|
private UrlBuilder |
currentUrl
The URL of the current page, so we can build all the pagination urls from here
|
count, limit, offset
Constructor and Description |
---|
PaginatedSearchResult(List<T> results,
int offset,
int limit,
int count) |
PaginatedSearchResult(String explanation,
String correctedUserQuery,
String aoSql,
int offset,
int limit,
int count,
List<T> results) |
Modifier and Type | Method and Description |
---|---|
int |
getCurrentPage() |
String |
getFirstPageUrl() |
int |
getLastPageOffset() |
String |
getLastPageUrl() |
int |
getNextPageOffset() |
String |
getNextPageUrl() |
int |
getPreviousPageOffset() |
String |
getPreviousPageUrl() |
int |
getTotalPages() |
boolean |
isFirstPage()
Returns true if the link to the first page shouldn't be displayed
|
boolean |
isLastPage()
Returns true if there is no other page after that
|
void |
setCurrentUrl(UrlBuilder currentUrl) |
String |
toString() |
add, addAllMessages, addKeySuggestions, getAoSql, getCorrectedUserQuery, getCount, getExplanation, getKeySuggestions, getLimit, getMessages, getOffset, getParsingResult, getResults, getResultsForModification, getResultsForSort, hasMore, isPaginationActive, isUsable, setCount, setUsable
private UrlBuilder currentUrl
public PaginatedSearchResult(String explanation, String correctedUserQuery, String aoSql, int offset, int limit, int count, List<T> results)
public int getCurrentPage()
public int getTotalPages()
public boolean isFirstPage()
public boolean isLastPage()
public void setCurrentUrl(UrlBuilder currentUrl)
public String getFirstPageUrl()
public int getLastPageOffset()
public String getLastPageUrl()
public int getPreviousPageOffset()
public String getPreviousPageUrl()
public int getNextPageOffset()
public String getNextPageUrl()
public String toString()
toString
in class SearchResult<T>
Copyright © 2021 Play SQL. All rights reserved.