Interface Builder<T>

Type Parameters:
T - Build target type - 构建目标类型
All Known Implementing Classes:
BeanBuilder, MapBuilder, RecordBuilder
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 Builder<T>
Builder Interface - Functional interface for object building 构建器接口 - 对象构建的函数式接口

Base functional interface for implementing builder pattern.

用于实现构建器模式的基础函数式接口。

Features | 主要功能:

  • Build target object (build) - 构建目标对象
  • Lambda-compatible functional interface - Lambda 兼容的函数式接口

Usage Examples | 使用示例:

Builder<User> builder = () -> new User("name", 18);
User user = builder.build();

Security | 安全性:

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

    Modifier and Type
    Method
    Description
    Builds the target object.
  • Method Details

    • build

      T build()
      Builds the target object. 构建目标对象。
      Returns:
      the built object | 构建的对象