@Immutable public interface Path extends Iterable<String>, Comparable<Path>
Modifier and Type | Method and Description |
---|---|
String |
get(int segmentNumber)
Get a particular segment within this path.
|
String |
getFirst()
Get the first segment in the path.
|
String |
getLast()
Get the last segment in the path.
|
Path |
parent()
Get the parent path, which may be an empty path.
|
int |
size()
Get the number of segments in this path.
|
boolean |
startsWith(Path other)
Determine if the first segments of this path are equal to the segments in the supplied path.
|
Path |
with(String fieldName)
Obtain a path that has this path as the parent and which has as the last segment the supplied field name.
|
forEach, iterator, spliterator
compareTo
String get(int segmentNumber)
segmentNumber
- the 0-based index of the segment in this pathIndexOutOfBoundsException
- if the segment number is negative, or greater than or equal to the size
.String getLast()
String getFirst()
int size()
Path with(String fieldName)
fieldName
- the field name for the last segment in the new path; may be nullfieldName
parameter is null; never nullPath parent()
boolean startsWith(Path other)
other
- the other path; may not be nullCopyright © 2008–2016 JBoss, a division of Red Hat. All rights reserved.