Class JsonConfig.Builder

java.lang.Object
cloud.opencode.base.json.JsonConfig.Builder
Enclosing class:
JsonConfig

public static final class JsonConfig.Builder extends Object
Builder for JsonConfig. JsonConfig 的构建器。
Since:
JDK 25, opencode-base-json V1.0.0
Author:
Leon Soo www.LeonSoo.com
  • Method Details

    • enable

      public JsonConfig.Builder enable(JsonFeature feature)
      Enables a feature. 启用特性。
      Parameters:
      feature - the feature to enable - 要启用的特性
      Returns:
      this builder - 此构建器
    • enable

      public JsonConfig.Builder enable(JsonFeature... features)
      Enables multiple features. 启用多个特性。
      Parameters:
      features - the features to enable - 要启用的特性
      Returns:
      this builder - 此构建器
    • disable

      public JsonConfig.Builder disable(JsonFeature feature)
      Disables a feature. 禁用特性。
      Parameters:
      feature - the feature to disable - 要禁用的特性
      Returns:
      this builder - 此构建器
    • disable

      public JsonConfig.Builder disable(JsonFeature... features)
      Disables multiple features. 禁用多个特性。
      Parameters:
      features - the features to disable - 要禁用的特性
      Returns:
      this builder - 此构建器
    • namingStrategy

      public JsonConfig.Builder namingStrategy(JsonNaming.Strategy strategy)
      Sets the naming strategy. 设置命名策略。
      Parameters:
      strategy - the naming strategy - 命名策略
      Returns:
      this builder - 此构建器
    • dateFormat

      public JsonConfig.Builder dateFormat(String format)
      Sets the date format pattern. 设置日期格式模式。
      Parameters:
      format - the date format - 日期格式
      Returns:
      this builder - 此构建器
    • timezone

      public JsonConfig.Builder timezone(ZoneId timezone)
      Sets the timezone. 设置时区。
      Parameters:
      timezone - the timezone - 时区
      Returns:
      this builder - 此构建器
    • timezone

      public JsonConfig.Builder timezone(String timezoneId)
      Sets the timezone by ID. 按 ID 设置时区。
      Parameters:
      timezoneId - the timezone ID - 时区 ID
      Returns:
      this builder - 此构建器
    • maxDepth

      public JsonConfig.Builder maxDepth(int maxDepth)
      Sets the maximum nesting depth. 设置最大嵌套深度。
      Parameters:
      maxDepth - the max depth - 最大深度
      Returns:
      this builder - 此构建器
    • maxStringLength

      public JsonConfig.Builder maxStringLength(int maxStringLength)
      Sets the maximum string length. 设置最大字符串长度。
      Parameters:
      maxStringLength - the max string length - 最大字符串长度
      Returns:
      this builder - 此构建器
    • maxSize

      public JsonConfig.Builder maxSize(int maxSize)
      Sets the maximum array/object size. 设置最大数组/对象大小。
      Parameters:
      maxSize - the max size - 最大大小
      Returns:
      this builder - 此构建器
    • indent

      public JsonConfig.Builder indent(String indent)
      Sets the indentation string. 设置缩进字符串。
      Parameters:
      indent - the indent - 缩进
      Returns:
      this builder - 此构建器
    • prettyPrint

      public JsonConfig.Builder prettyPrint()
      Enables pretty printing. 启用美化打印。
      Returns:
      this builder - 此构建器
    • build

      public JsonConfig build()
      Builds the configuration. 构建配置。
      Returns:
      the built config - 构建的配置