Class YmlConfig.Builder
java.lang.Object
cloud.opencode.base.yml.YmlConfig.Builder
- Enclosing class:
YmlConfig
Configuration Builder
配置构建器
- Since:
- JDK 25, opencode-base-yml V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
-
Method Summary
Modifier and TypeMethodDescriptionallowDuplicateKeys(boolean allow) Sets whether to allow duplicate keys.build()Builds the configuration.defaultFlowStyle(YmlConfig.FlowStyle flowStyle) Sets the default flow style.defaultScalarStyle(YmlConfig.ScalarStyle scalarStyle) Sets the default scalar style.indent(int indent) Sets the indent size.maxAliasesForCollections(int max) Sets the maximum aliases for collections.maxDocumentSize(long size) Sets the maximum document size.maxNestingDepth(int depth) Sets the maximum nesting depth.prettyPrint(boolean prettyPrint) Sets whether to pretty print.safeMode(boolean safe) Sets whether to enable safe mode.strictTypes(boolean strictTypes) Sets whether to enable strict types mode.
-
Method Details
-
indent
Sets the indent size. 设置缩进大小。- Parameters:
indent- the indent spaces | 缩进空格数- Returns:
- this builder | 此构建器
-
prettyPrint
Sets whether to pretty print. 设置是否美化打印。- Parameters:
prettyPrint- whether to pretty print | 是否美化打印- Returns:
- this builder | 此构建器
-
allowDuplicateKeys
Sets whether to allow duplicate keys. 设置是否允许重复键。- Parameters:
allow- whether to allow | 是否允许- Returns:
- this builder | 此构建器
-
safeMode
Sets whether to enable safe mode. 设置是否启用安全模式。- Parameters:
safe- whether safe mode is enabled | 是否启用安全模式- Returns:
- this builder | 此构建器
-
maxAliasesForCollections
Sets the maximum aliases for collections. 设置集合的最大别名数。- Parameters:
max- the maximum number | 最大数量- Returns:
- this builder | 此构建器
-
maxNestingDepth
Sets the maximum nesting depth. 设置最大嵌套深度。- Parameters:
depth- the maximum depth | 最大深度- Returns:
- this builder | 此构建器
-
maxDocumentSize
Sets the maximum document size. 设置最大文档大小。- Parameters:
size- the maximum size in bytes | 最大大小(字节)- Returns:
- this builder | 此构建器
-
defaultFlowStyle
Sets the default flow style. 设置默认流风格。- Parameters:
flowStyle- the flow style | 流风格- Returns:
- this builder | 此构建器
-
defaultScalarStyle
Sets the default scalar style. 设置默认标量风格。- Parameters:
scalarStyle- the scalar style | 标量风格- Returns:
- this builder | 此构建器
-
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
-