Class SerializerConfig.Builder
java.lang.Object
cloud.opencode.base.serialization.SerializerConfig.Builder
- Enclosing class:
SerializerConfig
Builder for SerializerConfig.
SerializerConfig 的构建器。
- Since:
- JDK 25, opencode-base-serialization V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the configuration.classFilter(ClassFilter classFilter) Sets the class filter for deserialization security.compressionAlgorithm(CompressionAlgorithm algorithm) Sets the compression algorithm.compressionThreshold(int threshold) Sets the compression threshold in bytes.enableCompression(boolean enable) Sets whether compression is enabled.failOnUnknownProperties(boolean fail) Sets whether to fail on unknown properties.includeTypeInfo(boolean include) Sets whether to include type information.
-
Method Details
-
includeTypeInfo
Sets whether to include type information. 设置是否包含类型信息。- Parameters:
include- true to include type info - 包含类型信息则为 true- Returns:
- this builder - 此构建器
-
enableCompression
Sets whether compression is enabled. 设置是否启用压缩。- Parameters:
enable- true to enable compression - 启用压缩则为 true- Returns:
- this builder - 此构建器
-
compressionAlgorithm
Sets the compression algorithm. 设置压缩算法。- Parameters:
algorithm- the compression algorithm - 压缩算法- Returns:
- this builder - 此构建器
-
compressionThreshold
Sets the compression threshold in bytes. 设置压缩阈值(字节)。- Parameters:
threshold- the threshold in bytes - 阈值(字节)- Returns:
- this builder - 此构建器
-
failOnUnknownProperties
Sets whether to fail on unknown properties. 设置是否对未知属性失败。- Parameters:
fail- true to fail on unknown properties - 对未知属性失败则为 true- Returns:
- this builder - 此构建器
-
classFilter
Sets the class filter for deserialization security. 设置反序列化安全的类过滤器。- Parameters:
classFilter- the class filter, may be null - 类过滤器,可以为 null- Returns:
- this builder - 此构建器
- Since:
- JDK 25, opencode-base-serialization V1.0.3
-
build
-