Class ConfigSectionNode

java.lang.Object
io.github.theword.queqiao.core.config.schema.ConfigNode
io.github.theword.queqiao.core.config.schema.ConfigSectionNode

public final class ConfigSectionNode extends ConfigNode
配置区块节点

它不是具体配置值,而是配置树中的一个区域(如 websocket_server)。 携带排版元数据:注释、前后空行数。

不可变:所有配置方法返回新实例,便于安全共享与并发快照。

Since:
0.6.12
  • Method Details

    • of

      public static ConfigSectionNode of(String path)
      创建一个空区块
      Parameters:
      path - 完整点分路径
      Returns:
      区块节点
    • comment

      public ConfigSectionNode comment(String... commentLines)
      设置注释(覆盖)
      Parameters:
      commentLines - 注释行
      Returns:
      新实例
    • blankLinesBefore

      public ConfigSectionNode blankLinesBefore(int count)
      设置区块前的空行数(只影响生成格式,不影响配置语义)
      Parameters:
      count - 空行数
      Returns:
      新实例
    • blankLinesAfter

      public ConfigSectionNode blankLinesAfter(int count)
      设置区块后的空行数(只影响生成格式,不影响配置语义)
      Parameters:
      count - 空行数
      Returns:
      新实例
    • getChildren

      public List<ConfigNode> getChildren()
      Returns:
      子节点(有序,只读)
    • getBlankLinesBefore

      public int getBlankLinesBefore()
    • getBlankLinesAfter

      public int getBlankLinesAfter()