Record Class TreeSerializer.SerializerConfig
java.lang.Object
java.lang.Record
cloud.opencode.base.tree.serialization.TreeSerializer.SerializerConfig
- Enclosing class:
TreeSerializer
public static record TreeSerializer.SerializerConfig(String idField, String parentIdField, String childrenField, String nodeElement, String rootElement, boolean prettyPrint, int indentSize, boolean includeParentId, boolean includeEmptyChildren, boolean includeXmlDeclaration, Function<?, Map<String,Object>> fieldExtractor)
extends Record
Serializer Configuration
序列化配置
- Since:
- JDK 25, opencode-base-tree V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classConfiguration Builder 配置构建器 -
Constructor Summary
ConstructorsConstructorDescriptionSerializerConfig(String idField, String parentIdField, String childrenField, String nodeElement, String rootElement, boolean prettyPrint, int indentSize, boolean includeParentId, boolean includeEmptyChildren, boolean includeXmlDeclaration, Function<?, Map<String, Object>> fieldExtractor) Compact constructor - sanitize XML element names to prevent injection 紧凑构造器 - 清理 XML 元素名称以防注入 -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Create builder for configuration 创建配置构建器Returns the value of thechildrenFieldrecord component.Create default configuration 创建默认配置final booleanIndicates whether some other object is "equal to" this one.Returns the value of thefieldExtractorrecord component.final inthashCode()Returns a hash code value for this object.idField()Returns the value of theidFieldrecord component.booleanReturns the value of theincludeEmptyChildrenrecord component.booleanReturns the value of theincludeParentIdrecord component.booleanReturns the value of theincludeXmlDeclarationrecord component.intReturns the value of theindentSizerecord component.Returns the value of thenodeElementrecord component.Returns the value of theparentIdFieldrecord component.booleanReturns the value of theprettyPrintrecord component.Returns the value of therootElementrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
SerializerConfig
public SerializerConfig(String idField, String parentIdField, String childrenField, String nodeElement, String rootElement, boolean prettyPrint, int indentSize, boolean includeParentId, boolean includeEmptyChildren, boolean includeXmlDeclaration, Function<?, Map<String, Object>> fieldExtractor) Compact constructor - sanitize XML element names to prevent injection 紧凑构造器 - 清理 XML 元素名称以防注入
-
-
Method Details
-
defaultConfig
Create default configuration 创建默认配置- Returns:
- the config | 配置
-
builder
Create builder for configuration 创建配置构建器- Returns:
- the builder | 构建器
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
idField
Returns the value of theidFieldrecord component.- Returns:
- the value of the
idFieldrecord component
-
parentIdField
Returns the value of theparentIdFieldrecord component.- Returns:
- the value of the
parentIdFieldrecord component
-
childrenField
Returns the value of thechildrenFieldrecord component.- Returns:
- the value of the
childrenFieldrecord component
-
nodeElement
Returns the value of thenodeElementrecord component.- Returns:
- the value of the
nodeElementrecord component
-
rootElement
Returns the value of therootElementrecord component.- Returns:
- the value of the
rootElementrecord component
-
prettyPrint
public boolean prettyPrint()Returns the value of theprettyPrintrecord component.- Returns:
- the value of the
prettyPrintrecord component
-
indentSize
public int indentSize()Returns the value of theindentSizerecord component.- Returns:
- the value of the
indentSizerecord component
-
includeParentId
public boolean includeParentId()Returns the value of theincludeParentIdrecord component.- Returns:
- the value of the
includeParentIdrecord component
-
includeEmptyChildren
public boolean includeEmptyChildren()Returns the value of theincludeEmptyChildrenrecord component.- Returns:
- the value of the
includeEmptyChildrenrecord component
-
includeXmlDeclaration
public boolean includeXmlDeclaration()Returns the value of theincludeXmlDeclarationrecord component.- Returns:
- the value of the
includeXmlDeclarationrecord component
-
fieldExtractor
-