Class ZPathImpl
- All Implemented Interfaces:
Resolvable
,ZPath
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturn a ZPath that represents a child ZNode of this ZPath.boolean
static ZPath
static ZPath
static ZPath
static ZPath
fullPath()
The string full path that this ZPath representsint
hashCode()
boolean
Return true if this path is fully resolved (i.e.boolean
isRoot()
Return true/false if this is the root ZPathnodeName()
The node name at this ZPathparent()
Return this ZPath's parentstatic ZPath
parse
(String fullPath, UnaryOperator<String> nameFilter) When creating paths, any node in the path can be set toZPath.parameter()
.boolean
startsWith
(ZPath path) Return true if this path starts with the given path.Return a regex Pattern useful for using inSchema
toString()
-
Field Details
-
root
-
-
Method Details
-
parse
-
from
-
from
-
from
-
from
-
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 implementsNodeName
, the value ofnodeName()
. -
parent
Description copied from interface:ZPath
Return this ZPath's parent -
isRoot
public boolean isRoot()Description copied from interface:ZPath
Return true/false if this is the root ZPath -
startsWith
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 interfaceZPath
- Parameters:
path
- base path- Returns:
- true/false
-
toSchemaPathPattern
Description copied from interface:ZPath
Return a regex Pattern useful for using inSchema
- Specified by:
toSchemaPathPattern
in interfaceZPath
- Returns:
- pattern for this path
-
fullPath
Description copied from interface:ZPath
The string full path that this ZPath represents -
nodeName
Description copied from interface:ZPath
The node name at this ZPath -
equals
-
hashCode
public int hashCode() -
toString
-
resolved
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 implementsNodeName
, the value ofnodeName()
.- Specified by:
resolved
in interfaceResolvable
- Specified by:
resolved
in interfaceZPath
- 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 interfaceZPath
- Returns:
- true/false
-