@API.Public @API.Immutable public final class FieldPath extends Object implements Comparable<FieldPath>, Iterable<FieldSegment>, Expression
| Constructor and Description |
|---|
FieldPath(FieldSegment.NameSegment root)
For Antlr parser's use only.
|
| Modifier and Type | Method and Description |
|---|---|
String |
asJsonString() |
String |
asJsonString(JsonOptions options) |
String |
asPathString()
Returns the
String representation of this field path, quoting
only those name segments which were parsed from a quoted identifier. |
String |
asPathString(boolean quote) |
FieldPath |
cloneAfterAncestor(FieldPath ancestor) |
FieldPath |
cloneWithNewChild(FieldSegment childSegment) |
FieldPath |
cloneWithNewChild(int index) |
FieldPath |
cloneWithNewChild(String childSegment) |
FieldPath |
cloneWithNewParent(String parentSegment) |
int |
compareTo(FieldPath other)
Compares two FieldPath segment by segment from left to right.
|
boolean |
equals(Object obj) |
String |
getName() |
FieldSegment |
getRootSegment() |
int |
hashCode() |
boolean |
isAtOrAbove(FieldPath other) |
boolean |
isAtOrBelow(FieldPath other) |
Iterator<FieldSegment> |
iterator() |
static FieldPath |
parseFrom(String fieldPath)
Use this method to translate a
String into FieldPath. |
FieldSegment |
segmentAfterAncestor(FieldPath ancestor) |
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitforEach, spliteratorpublic static final FieldPath EMPTY
@API.Internal public FieldPath(FieldSegment.NameSegment root)
public static FieldPath parseFrom(@API.NonNullable String fieldPath)
String into FieldPath.fieldPath - the String to parseFieldPath parsed from the input stringNullPointerException - if the input string is nullIllegalArgumentException - if the input string has syntax errorpublic Iterator<FieldSegment> iterator()
iterator in interface Iterable<FieldSegment>public int compareTo(FieldPath other)
compareTo in interface Comparable<FieldPath>0 if the specified FieldPath is equal to
this FieldPath; a value less than 0 if this FieldPath
is smaller than the specified FieldPath; and a value greater
than 0 if this FieldPath is greater than the specified
FieldPathpublic String asPathString()
String representation of this field path, quoting
only those name segments which were parsed from a quoted identifier.String representation of this FieldPath.public String asPathString(boolean quote)
public FieldSegment getRootSegment()
public FieldPath cloneWithNewParent(String parentSegment)
public FieldPath cloneWithNewChild(String childSegment)
public FieldPath cloneWithNewChild(int index)
public FieldPath cloneWithNewChild(FieldSegment childSegment)
FieldPath with specified added as
the child of the leaf of this FieldPathpublic FieldPath cloneAfterAncestor(FieldPath ancestor)
public boolean isAtOrBelow(FieldPath other)
FieldPath is same or a child of thispublic boolean isAtOrAbove(FieldPath other)
FieldPath is same or parent of thispublic FieldSegment segmentAfterAncestor(FieldPath ancestor)
FieldPath contains ancestor
entirely, returns if field and ancestor are identical field
paths or returns if field and ancestor have a difference of at least
one field or its type.public String asJsonString()
asJsonString in interface JsonStringpublic String asJsonString(JsonOptions options)
asJsonString in interface JsonStringpublic String getName()
getName in interface ExpressionCopyright © 2015–2018 MapR Technologies, Inc.. All rights reserved.