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
|
private String |
filter |
private String |
sortBy |
private String |
sortOrder |
count, limit, offset
Constructor and Description |
---|
PaginatedSearchResult(List<T> results,
int offset,
int limit,
int count) |
PaginatedSearchResult(List<T> results,
int offset,
int limit,
int count,
String sortBy,
String sortOrder,
String filter) |
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 |
getFilter() |
String |
getFirstPageUrl() |
int |
getLastPageOffset() |
String |
getLastPageUrl() |
int |
getNextPageOffset() |
String |
getNextPageUrl() |
int |
getPreviousPageOffset() |
String |
getPreviousPageUrl() |
String |
getSortBy() |
String |
getSortOrder() |
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
private String sortBy
private String sortOrder
private String filter
public PaginatedSearchResult(String explanation, String correctedUserQuery, String aoSql, int offset, int limit, int count, List<T> results)
public PaginatedSearchResult(List<T> results, int offset, int limit, int count)
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 getSortBy()
public String getSortOrder()
public String getFilter()
public String toString()
toString
in class SearchResult<T>
Copyright © 2022 Requirement Yogi. All rights reserved.