Class OwnedPaths.Builder

java.lang.Object
com.ultikits.ultitools.config.document.OwnedPaths.Builder
Enclosing class:
OwnedPaths

public static final class OwnedPaths.Builder extends Object
Collects owned paths; each path is copied, so later changes to the caller's list do not leak in.
  • Field Details

  • Constructor Details

    • Builder

      private Builder()
  • Method Details

    • value

      public OwnedPaths.Builder value(List<String> path)
      Owns the whole key at path: its value and, when it is inserted or removed, its comment.
      Parameters:
      path - the key path, at least one key
      Returns:
      this builder
    • comment

      public OwnedPaths.Builder comment(List<String> path)
      Owns the comment lines directly above the key at path.
      Parameters:
      path - the key path, at least one key
      Returns:
      this builder
    • frameworkComment

      public OwnedPaths.Builder frameworkComment(List<String> path, int linesInFile)
      Owns only the last linesInFile comment lines directly above the key at path - the run the framework identified as its own comment in the file as read (0 when the key has no comment) - and the lines that replace them. Every comment line above that run is not owned, so the gate refuses a write that changes one of them (maintainer decision 2026-10-04, "only the framework's own comments are rewritten").
      Parameters:
      path - the key path, at least one key
      linesInFile - the length of the owned run in the file as read, at least 0
      Returns:
      this builder
    • build

      public OwnedPaths build()
      Builds the immutable description.
      Returns:
      the owned paths
    • add

      private static void add(List<List<String>> target, List<String> path)