com.vaadin.flow.data.provider.hierarchy.

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 type

F - 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:

  • Constructor Details

    • 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 be null

      parent - the hierarchical parent object, null corresponding 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 fetch

      limit - fetched item count

      sortOrders - sorting order for fetching; used for sorting backends

      inMemorySorting - comparator for sorting in-memory data

      filter - filtering for fetching; can be null

      parent - the hierarchical parent object, null corresponding to the root node

  • Method Details

    • getParent

      public T getParent()

      Get the hierarchical parent object, where null corresponds 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: