java.lang.Object
org.apache.curator.x.async.modeled.details.ZPathImpl
All Implemented Interfaces:
Resolvable, ZPath

public class ZPathImpl extends Object implements ZPath
  • Field Details

    • root

      public static final ZPath root
  • Method Details

    • parse

      public static ZPath parse(String fullPath, UnaryOperator<String> nameFilter)
    • from

      public static ZPath from(String[] names)
    • from

      public static ZPath from(List<String> names)
    • from

      public static ZPath from(ZPath base, String[] names)
    • from

      public static ZPath from(ZPath base, List<String> names)
    • child

      public ZPath child(Object child)
      Description copied from interface: ZPath

      Return a ZPath that represents a child ZNode of this ZPath. e.g. ZPath.from("a", "b").at("c") represents the path "/a/b/c"

      The replacement is the toString() value of child or, if it implements NodeName, the value of nodeName().

      Specified by:
      child in interface ZPath
      Parameters:
      child - child node name
      Returns:
      ZPath
    • parent

      public ZPath parent()
      Description copied from interface: ZPath
      Return this ZPath's parent
      Specified by:
      parent in interface ZPath
      Returns:
      parent ZPath
    • isRoot

      public boolean isRoot()
      Description copied from interface: ZPath
      Return true/false if this is the root ZPath
      Specified by:
      isRoot in interface ZPath
      Returns:
      true false
    • startsWith

      public boolean startsWith(ZPath path)
      Description copied from interface: ZPath
      Return true if this path starts with the given path. i.e. ZPath.from("/one/two/three").startsWith(ZPath.from("/one/two")) returns true
      Specified by:
      startsWith in interface ZPath
      Parameters:
      path - base path
      Returns:
      true/false
    • toSchemaPathPattern

      public Pattern toSchemaPathPattern()
      Description copied from interface: ZPath
      Return a regex Pattern useful for using in Schema
      Specified by:
      toSchemaPathPattern in interface ZPath
      Returns:
      pattern for this path
    • fullPath

      public String fullPath()
      Description copied from interface: ZPath
      The string full path that this ZPath represents
      Specified by:
      fullPath in interface ZPath
      Returns:
      full path
    • nodeName

      public String nodeName()
      Description copied from interface: ZPath
      The node name at this ZPath
      Specified by:
      nodeName in interface ZPath
      Returns:
      name
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • resolved

      public ZPath resolved(List<Object> parameters)
      Description copied from interface: ZPath

      When creating paths, any node in the path can be set to ZPath.parameter(). At runtime, the ZPath can be "resolved" by replacing these nodes with values.

      The replacement is the toString() value of the parameter object or, if the object implements NodeName, the value of nodeName().

      Specified by:
      resolved in interface Resolvable
      Specified by:
      resolved in interface ZPath
      Parameters:
      parameters - list of replacements. Must have be the same length as the number of parameter nodes in the path
      Returns:
      new resolved ZPath
    • isResolved

      public boolean isResolved()
      Description copied from interface: ZPath
      Return true if this path is fully resolved (i.e. has no unresolved parameters).

      Note: ZPath's returned by the parse() method are always considered fully resolved, despite if there are remaining elements in the path which appear to be parameters (but are not, i.e. {one}).

      When working with parameters, use the parseWithIds() method, which returns a ZPath with a resolved state based on the presence of unresolved parameter elements in the ZPath.

      Specified by:
      isResolved in interface ZPath
      Returns:
      true/false