Class YmlConfig.Builder

java.lang.Object
cloud.opencode.base.yml.YmlConfig.Builder
Enclosing class:
YmlConfig

public static final class YmlConfig.Builder extends Object
Configuration Builder 配置构建器
Since:
JDK 25, opencode-base-yml V1.0.0
Author:
Leon Soo www.LeonSoo.com
  • Method Details

    • indent

      public YmlConfig.Builder indent(int indent)
      Sets the indent size. 设置缩进大小。
      Parameters:
      indent - the indent spaces | 缩进空格数
      Returns:
      this builder | 此构建器
    • prettyPrint

      public YmlConfig.Builder prettyPrint(boolean prettyPrint)
      Sets whether to pretty print. 设置是否美化打印。
      Parameters:
      prettyPrint - whether to pretty print | 是否美化打印
      Returns:
      this builder | 此构建器
    • allowDuplicateKeys

      public YmlConfig.Builder allowDuplicateKeys(boolean allow)
      Sets whether to allow duplicate keys. 设置是否允许重复键。
      Parameters:
      allow - whether to allow | 是否允许
      Returns:
      this builder | 此构建器
    • safeMode

      public YmlConfig.Builder safeMode(boolean safe)
      Sets whether to enable safe mode. 设置是否启用安全模式。
      Parameters:
      safe - whether safe mode is enabled | 是否启用安全模式
      Returns:
      this builder | 此构建器
    • maxAliasesForCollections

      public YmlConfig.Builder maxAliasesForCollections(int max)
      Sets the maximum aliases for collections. 设置集合的最大别名数。
      Parameters:
      max - the maximum number | 最大数量
      Returns:
      this builder | 此构建器
    • maxNestingDepth

      public YmlConfig.Builder maxNestingDepth(int depth)
      Sets the maximum nesting depth. 设置最大嵌套深度。
      Parameters:
      depth - the maximum depth | 最大深度
      Returns:
      this builder | 此构建器
    • maxDocumentSize

      public YmlConfig.Builder maxDocumentSize(long size)
      Sets the maximum document size. 设置最大文档大小。
      Parameters:
      size - the maximum size in bytes | 最大大小(字节)
      Returns:
      this builder | 此构建器
    • defaultFlowStyle

      public YmlConfig.Builder defaultFlowStyle(YmlConfig.FlowStyle flowStyle)
      Sets the default flow style. 设置默认流风格。
      Parameters:
      flowStyle - the flow style | 流风格
      Returns:
      this builder | 此构建器
    • defaultScalarStyle

      public YmlConfig.Builder defaultScalarStyle(YmlConfig.ScalarStyle scalarStyle)
      Sets the default scalar style. 设置默认标量风格。
      Parameters:
      scalarStyle - the scalar style | 标量风格
      Returns:
      this builder | 此构建器
    • strictTypes

      public YmlConfig.Builder strictTypes(boolean strictTypes)
      Sets whether to enable strict types mode. 设置是否启用严格类型模式。

      When enabled, YAML 1.1 boolean values (YES/NO/ON/OFF/y/n/Y/N) are treated as strings instead of being converted to booleans.

      启用时,YAML 1.1 布尔值(YES/NO/ON/OFF/y/n/Y/N)将被视为字符串, 而不会被转换为布尔值。

      Parameters:
      strictTypes - whether strict types is enabled | 是否启用严格类型
      Returns:
      this builder | 此构建器
    • build

      public YmlConfig build()
      Builds the configuration. 构建配置。
      Returns:
      the configuration | 配置