Class ContextBuilder

java.lang.Object
cloud.opencode.base.string.template.ContextBuilder

public final class ContextBuilder extends Object
Context Builder - Builder for template rendering context. 上下文构建器 - 模板渲染上下文的构建器。

Features | 主要功能:

  • Fluent API for building template context - 流式API构建模板上下文
  • Single and batch variable setting - 单个和批量变量设置

Usage Examples | 使用示例:

TemplateContext ctx = ContextBuilder.create()
    .set("name", "World")
    .set("greeting", "Hello")
    .build();

Security | 安全性:

  • Thread-safe: No (mutable builder) - 线程安全: 否(可变构建器)

Performance | 性能特性:

  • Time complexity: O(1) per variable binding - 每次变量绑定 O(1)
  • Space complexity: O(n) where n = context variables - O(n), n为上下文变量数
Since:
JDK 25, opencode-base-string V1.0.0
Author:
Leon Soo www.LeonSoo.com
See Also: