Interface LazyChildLoader<T,ID>

Type Parameters:
T - the node type | 节点类型
ID - the ID type | ID类型
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface LazyChildLoader<T,ID>
Lazy Child Loader 懒加载子节点加载器

Functional interface for loading children on demand.

用于按需加载子节点的函数式接口。

Features | 主要功能:

  • Functional interface for lazy child loading - 用于懒加载子节点的函数式接口
  • Supports lambda and method reference - 支持lambda和方法引用
  • Used by VirtualTree for on-demand loading - 被VirtualTree用于按需加载

Usage Examples | 使用示例:

// Lambda implementation - Lambda实现
LazyChildLoader<VirtualTree<String, Long>, Long> loader =
    parentId -> database.findChildrenByParentId(parentId);

// Method reference - 方法引用
LazyChildLoader<VirtualTree<String, Long>, Long> loader = repository::findByParentId;

Security | 安全性:

  • Thread-safe: Depends on implementation - 线程安全: 取决于实现
  • Null-safe: Depends on implementation - 空值安全: 取决于实现
Since:
JDK 25, opencode-base-tree V1.0.0
Author:
Leon Soo www.LeonSoo.com
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    loadChildren(ID parentId)
    Load children for the given parent ID 加载指定父节点ID的子节点
  • Method Details

    • loadChildren

      List<T> loadChildren(ID parentId)
      Load children for the given parent ID 加载指定父节点ID的子节点
      Parameters:
      parentId - the parent ID | 父节点ID
      Returns:
      the children list | 子节点列表