Class HierarchicalQuery<T,F>
- java.lang.Object
-
- com.vaadin.flow.data.provider.Query<T,F>
-
- com.vaadin.flow.data.provider.hierarchy.HierarchicalQuery<T,F>
-
- Type Parameters:
T- bean typeF- filter type
- All Implemented Interfaces:
Serializable
public class HierarchicalQuery<T,F> extends Query<T,F>
Immutable hierarchical query object used to request data from a backend. Contains the parent node, index limits, sorting and filtering information.- Since:
- 1.2
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description HierarchicalQuery(int offset, int limit, List<QuerySortOrder> sortOrders, Comparator<T> inMemorySorting, F filter, T parent)Constructs a new hierarchical query object with given offset, limit, sorting and filtering.HierarchicalQuery(F filter, T parent)Constructs a new hierarchical query object with given filter and parent node.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TgetParent()Get the hierarchical parent object, wherenullcorresponds to the root node.Optional<T>getParentOptional()Get an Optional of the hierarchical parent object.-
Methods inherited from class com.vaadin.flow.data.provider.Query
getFilter, getInMemorySorting, getLimit, getOffset, getPage, getPageSize, getRequestedRangeEnd, getSortingComparator, getSortOrders
-
-
-
-
Constructor Detail
-
HierarchicalQuery
public HierarchicalQuery(F filter, T parent)
Constructs a new hierarchical query object with given filter and parent node.- Parameters:
filter- filtering for fetching; can benullparent- the hierarchical parent object,nullcorresponding to the root node
-
HierarchicalQuery
public HierarchicalQuery(int offset, int limit, List<QuerySortOrder> sortOrders, Comparator<T> inMemorySorting, F filter, T parent)Constructs a new hierarchical query object with given offset, limit, sorting and filtering.- Parameters:
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 benullparent- the hierarchical parent object,nullcorresponding to the root node
-
-
Method Detail
-
getParent
public T getParent()
Get the hierarchical parent object, wherenullcorresponds to the root node.- Returns:
- the hierarchical parent object
-
getParentOptional
public Optional<T> getParentOptional()
Get an Optional of the hierarchical parent object.- Returns:
- the result of
getParent()wrapped by an Optional - See Also:
getParent()
-
-