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
  • 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

      public static TreeSerializer.SerializerConfig defaultConfig()
      Create default configuration 创建默认配置
      Returns:
      the config | 配置
    • builder

      public static TreeSerializer.SerializerConfig.Builder builder()
      Create builder for configuration 创建配置构建器
      Returns:
      the builder | 构建器
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • idField

      public String idField()
      Returns the value of the idField record component.
      Returns:
      the value of the idField record component
    • parentIdField

      public String parentIdField()
      Returns the value of the parentIdField record component.
      Returns:
      the value of the parentIdField record component
    • childrenField

      public String childrenField()
      Returns the value of the childrenField record component.
      Returns:
      the value of the childrenField record component
    • nodeElement

      public String nodeElement()
      Returns the value of the nodeElement record component.
      Returns:
      the value of the nodeElement record component
    • rootElement

      public String rootElement()
      Returns the value of the rootElement record component.
      Returns:
      the value of the rootElement record component
    • prettyPrint

      public boolean prettyPrint()
      Returns the value of the prettyPrint record component.
      Returns:
      the value of the prettyPrint record component
    • indentSize

      public int indentSize()
      Returns the value of the indentSize record component.
      Returns:
      the value of the indentSize record component
    • includeParentId

      public boolean includeParentId()
      Returns the value of the includeParentId record component.
      Returns:
      the value of the includeParentId record component
    • includeEmptyChildren

      public boolean includeEmptyChildren()
      Returns the value of the includeEmptyChildren record component.
      Returns:
      the value of the includeEmptyChildren record component
    • includeXmlDeclaration

      public boolean includeXmlDeclaration()
      Returns the value of the includeXmlDeclaration record component.
      Returns:
      the value of the includeXmlDeclaration record component
    • fieldExtractor

      public Function<?, Map<String,Object>> fieldExtractor()
      Returns the value of the fieldExtractor record component.
      Returns:
      the value of the fieldExtractor record component