com.vaadin.data.provider.

Interface HierarchicalDataProvider<T,F>

    • Method Detail

      • size

        default int size(Query<T,F> query)

        Get the number of immediate child data items for the parent item returned by a given query.

        Specified by:

        size in interface DataProvider<T,F>

        Parameters:

        query - given query to request the count for

        Returns:

        the count of child data items for the data item HierarchicalQuery.getParent()

        Throws:

        IllegalArgumentException - if the query is not of type HierarchicalQuery

      • fetch

        default Stream<T> fetch(Query<T,F> query)

        Fetches data from this HierarchicalDataProvider using given query. Only the immediate children of HierarchicalQuery.getParent() will be returned.

        Specified by:

        fetch in interface DataProvider<T,F>

        Parameters:

        query - given query to request data with

        Returns:

        a stream of data objects resulting from the query

        Throws:

        IllegalArgumentException - if the query is not of type HierarchicalQuery

      • getChildCount

        int getChildCount(HierarchicalQuery<T,F> query)

        Get the number of immediate child data items for the parent item returned by a given query.

        Parameters:

        query - given query to request the count for

        Returns:

        the count of child data items for the data item HierarchicalQuery.getParent()

      • fetchChildren

        Stream<T> fetchChildren(HierarchicalQuery<T,F> query)

        Fetches data from this HierarchicalDataProvider using given query. Only the immediate children of HierarchicalQuery.getParent() will be returned.

        Parameters:

        query - given query to request data with

        Returns:

        a stream of data objects resulting from the query

      • hasChildren

        boolean hasChildren(T item)

        Check whether a given item has any children associated with it.

        Parameters:

        item - the item to check for children

        Returns:

        whether the given item has children