@PublicApi public class ResultPath extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
ResultPath |
append(ResultPath path)
Appends the provided path to the current one
|
ResultPath |
dropSegment()
Drops the last segment off the path
|
boolean |
equals(java.lang.Object o) |
static ResultPath |
fromList(java.util.List<?> objects)
This will create an execution path from the list of objects
|
java.util.List<java.lang.String> |
getKeysOnly() |
int |
getLevel() |
ResultPath |
getParent() |
ResultPath |
getPathWithoutListEnd() |
int |
getSegmentIndex() |
java.lang.String |
getSegmentName() |
java.lang.Object |
getSegmentValue() |
int |
hashCode() |
boolean |
isListSegment() |
boolean |
isNamedSegment() |
boolean |
isRootPath() |
static ResultPath |
parse(java.lang.String pathString)
Parses an execution path from the provided path string in the format /segment1/segment2[index]/segmentN
|
ResultPath |
replaceSegment(int segment)
Replaces the last segment on the path eg ResultPath.parse("/a/b[1]").replaceSegment(9)
equals "/a/b[9]"
|
ResultPath |
replaceSegment(java.lang.String segment)
Replaces the last segment on the path eg ResultPath.parse("/a/b[1]").replaceSegment("x")
equals "/a/b/x"
|
static ResultPath |
rootPath()
All paths start from here
|
ResultPath |
segment(int segment)
Takes the current path and adds a new segment to it, returning a new path
|
ResultPath |
segment(java.lang.String segment)
Takes the current path and adds a new segment to it, returning a new path
|
java.lang.String |
segmentToString() |
ResultPath |
sibling(int siblingField) |
ResultPath |
sibling(java.lang.String siblingField) |
java.util.List<java.lang.Object> |
toList() |
java.lang.String |
toString() |
public static ResultPath rootPath()
public int getLevel()
public ResultPath getPathWithoutListEnd()
public boolean isListSegment()
public boolean isNamedSegment()
public java.lang.String getSegmentName()
public int getSegmentIndex()
public java.lang.Object getSegmentValue()
public ResultPath getParent()
public static ResultPath parse(java.lang.String pathString)
pathString
- the path stringpublic static ResultPath fromList(java.util.List<?> objects)
objects
- the path objectspublic ResultPath segment(java.lang.String segment)
segment
- the string path segment to addpublic ResultPath segment(int segment)
segment
- the int path segment to addpublic ResultPath dropSegment()
public ResultPath replaceSegment(int segment)
segment
- the integer segment to usepublic ResultPath replaceSegment(java.lang.String segment)
segment
- the string segment to usepublic boolean isRootPath()
rootPath()
public ResultPath append(ResultPath path)
path
- the path to appendpublic ResultPath sibling(java.lang.String siblingField)
public ResultPath sibling(int siblingField)
public java.util.List<java.lang.Object> toList()
public java.util.List<java.lang.String> getKeysOnly()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String segmentToString()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object