Class DataPath

java.lang.Object
com.github.darksoulq.abyssallib.common.config.DataPath

public class DataPath extends Object
Represents a parsed hierarchical data path for querying and mutating nested structures.

Supported Path Syntaxes:

  • Standard Key: "inventory"
  • Nested Nodes: "inventory.weapon.damage"
  • List Indices: "players[3]"
  • Root List Index: "[0]"
  • Complex Chains: "players[3].inventory.weapon[0].damage"
  • Method Details

    • of

      public static DataPath of(String path)
      Parses a string representation of a data path into structural segments.
      Parameters:
      path - The literal path string.
      Returns:
      A compiled DataPath instance.
    • segments

      public List<DataPath.Segment> segments()
      Returns:
      An immutable list of the parsed segments.
    • isEmpty

      public boolean isEmpty()
      Returns:
      True if the path contains zero segments.
    • asString

      public String asString()
      Reconstructs the string representation of the parsed path.
      Returns:
      The canonical path string.