T
- bean typeF
- filter typepublic class Query<T,F> extends Object implements Serializable
Constructor and Description |
---|
Query()
Constructs a Query for all rows from 0 to
Integer.MAX_VALUE
without sorting and filtering. |
Query(F filter)
Constructs a Query for all rows from 0 to
Integer.MAX_VALUE with
filtering. |
Query(int offset,
int limit,
List<QuerySortOrder> sortOrders,
Comparator<T> inMemorySorting,
F filter)
Constructs a new Query object with given offset, limit, sorting and
filtering.
|
Modifier and Type | Method and Description |
---|---|
Optional<F> |
getFilter()
Gets the filter for items to fetch.
|
Comparator<T> |
getInMemorySorting()
Gets the comparator for sorting in-memory data.
|
int |
getLimit()
Gets the number of items to fetch.
|
int |
getOffset()
Gets the first index of items to fetch.
|
Optional<Comparator<T>> |
getSortingComparator()
Gets the optional comparator for sorting data.
|
List<QuerySortOrder> |
getSortOrders()
Gets the sorting for items to fetch.
|
public Query()
Integer.MAX_VALUE
without sorting and filtering.public Query(F filter)
Integer.MAX_VALUE
with
filtering.filter
- back end filter of a suitable type for the data provider; can
be nullpublic Query(int offset, int limit, List<QuerySortOrder> sortOrders, Comparator<T> inMemorySorting, F filter)
offset
- first index to fetchlimit
- fetched item countsortOrders
- sorting order for fetching; used for sorting backendsinMemorySorting
- comparator for sorting in-memory datafilter
- filtering for fetching; can be nullpublic int getOffset()
public int getLimit()
Note: It is possible that
offset + limit > item count
public List<QuerySortOrder> getSortOrders()
Note: Sort orders and in-memory sorting are mutually
exclusive. If the DataProvider
handles one, it should ignore the
other.
public Optional<F> getFilter()
public Comparator<T> getInMemorySorting()
Note: Sort orders and in-memory sorting are mutually
exclusive. If the DataProvider
handles one, it should ignore the
other.
public Optional<Comparator<T>> getSortingComparator()
Note: Sort orders and comparator sorting are mutually
exclusive. If the DataProvider
handles one, it should ignore the
other.
Copyright © 2025. All rights reserved.