Class JsonConfig.Builder
java.lang.Object
cloud.opencode.base.json.JsonConfig.Builder
- Enclosing class:
JsonConfig
Builder for JsonConfig.
JsonConfig 的构建器。
- Since:
- JDK 25, opencode-base-json V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the configuration.dateFormat(String format) Sets the date format pattern.disable(JsonFeature feature) Disables a feature.disable(JsonFeature... features) Disables multiple features.enable(JsonFeature feature) Enables a feature.enable(JsonFeature... features) Enables multiple features.Sets the indentation string.maxDepth(int maxDepth) Sets the maximum nesting depth.maxSize(int maxSize) Sets the maximum array/object size.maxStringLength(int maxStringLength) Sets the maximum string length.namingStrategy(JsonNaming.Strategy strategy) Sets the naming strategy.Enables pretty printing.Sets the timezone by ID.Sets the timezone.
-
Method Details
-
enable
Enables a feature. 启用特性。- Parameters:
feature- the feature to enable - 要启用的特性- Returns:
- this builder - 此构建器
-
enable
Enables multiple features. 启用多个特性。- Parameters:
features- the features to enable - 要启用的特性- Returns:
- this builder - 此构建器
-
disable
Disables a feature. 禁用特性。- Parameters:
feature- the feature to disable - 要禁用的特性- Returns:
- this builder - 此构建器
-
disable
Disables multiple features. 禁用多个特性。- Parameters:
features- the features to disable - 要禁用的特性- Returns:
- this builder - 此构建器
-
namingStrategy
Sets the naming strategy. 设置命名策略。- Parameters:
strategy- the naming strategy - 命名策略- Returns:
- this builder - 此构建器
-
dateFormat
Sets the date format pattern. 设置日期格式模式。- Parameters:
format- the date format - 日期格式- Returns:
- this builder - 此构建器
-
timezone
Sets the timezone. 设置时区。- Parameters:
timezone- the timezone - 时区- Returns:
- this builder - 此构建器
-
timezone
Sets the timezone by ID. 按 ID 设置时区。- Parameters:
timezoneId- the timezone ID - 时区 ID- Returns:
- this builder - 此构建器
-
maxDepth
Sets the maximum nesting depth. 设置最大嵌套深度。- Parameters:
maxDepth- the max depth - 最大深度- Returns:
- this builder - 此构建器
-
maxStringLength
Sets the maximum string length. 设置最大字符串长度。- Parameters:
maxStringLength- the max string length - 最大字符串长度- Returns:
- this builder - 此构建器
-
maxSize
Sets the maximum array/object size. 设置最大数组/对象大小。- Parameters:
maxSize- the max size - 最大大小- Returns:
- this builder - 此构建器
-
indent
Sets the indentation string. 设置缩进字符串。- Parameters:
indent- the indent - 缩进- Returns:
- this builder - 此构建器
-
prettyPrint
Enables pretty printing. 启用美化打印。- Returns:
- this builder - 此构建器
-
build
-