Interface HierarchicalData<T>

Type Parameters:
T - data type
All Superinterfaces:
Serializable
All Known Implementing Classes:
TreeData

public interface HierarchicalData<T> extends Serializable
Represents hierarchical data.

Typically used as a backing data source for InMemoryHierarchicalDataProvider.

Since:
25.2
Author:
Vaadin Ltd
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    contains(T item)
    Check whether the given item is in this hierarchy.
    getChildren(T item)
    Get the immediate child items for the given item.
    getParent(T item)
    Get the parent item for the given item.
  • Method Details

    • getChildren

      List<T> getChildren(T item)
      Get the immediate child items for the given item.
      Parameters:
      item - the item for which to retrieve child items for, null to retrieve all root items
      Returns:
      an unmodifiable list of child items for the given item
      Throws:
      IllegalArgumentException - if the item does not exist in this structure
    • getParent

      T getParent(T item)
      Get the parent item for the given item.
      Parameters:
      item - the item for which to retrieve the parent item for
      Returns:
      parent item for the given item or null if the item is a root item.
      Throws:
      IllegalArgumentException - if the item does not exist in this structure
    • contains

      boolean contains(T item)
      Check whether the given item is in this hierarchy.
      Parameters:
      item - the item to check
      Returns:
      true if the item is in this hierarchy, false if not