@API.Public @API.Immutable public abstract class FieldSegment extends Object implements Comparable<FieldSegment>, JsonString
Modifier and Type | Class and Description |
---|---|
static class |
FieldSegment.IndexSegment |
static class |
FieldSegment.NameSegment |
protected static class |
FieldSegment.Type |
Modifier and Type | Field and Description |
---|---|
protected FieldSegment |
child |
static Comparator<FieldSegment> |
FIELD_SEGMENT_COMPARATOR
A
Comparator that compares two FieldSegments solely on the segment
value itself, excluding their child, if any. |
protected int |
hash |
protected FieldSegment.Type |
type |
Modifier | Constructor and Description |
---|---|
protected |
FieldSegment(FieldSegment child) |
Modifier and Type | Method and Description |
---|---|
String |
asPathString(boolean quote) |
abstract FieldSegment |
clone() |
int |
compareTo(FieldSegment other) |
boolean |
contains(FieldSegment otherSeg)
Checks to see if another path is contained in this one.
|
boolean |
equals(Object obj) |
FieldSegment |
getChild() |
FieldSegment.IndexSegment |
getIndexSegment() |
FieldSegment.NameSegment |
getNameSegment() |
int |
hashCode() |
boolean |
isArray() |
boolean |
isIndexed() |
boolean |
isLastPath() |
boolean |
isLeaf() |
boolean |
isMap() |
boolean |
isNamed() |
protected abstract boolean |
segmentEquals(FieldSegment other) |
protected abstract int |
segmentHashCode() |
String |
toString() |
protected abstract StringBuilder |
writeSegment(StringBuilder sb,
boolean quoted) |
finalize, getClass, notify, notifyAll, wait, wait, wait
asJsonString, asJsonString
@API.Public public static final Comparator<FieldSegment> FIELD_SEGMENT_COMPARATOR
Comparator
that compares two FieldSegments solely on the segment
value itself, excluding their child, if any.protected final FieldSegment child
protected final FieldSegment.Type type
protected int hash
protected FieldSegment(FieldSegment child)
public boolean isMap()
true
if the current segment has a child and
child.isNamed()
is true
public boolean isArray()
true
if the current segment has a child and
child.isIndexed()
is true
public boolean isLeaf()
true
if the current segment has no childpublic boolean isIndexed()
true
if the current segment is identified by an indexpublic boolean isNamed()
true
if the current segment is identified by a namepublic abstract FieldSegment clone()
public FieldSegment.NameSegment getNameSegment()
public FieldSegment.IndexSegment getIndexSegment()
protected abstract StringBuilder writeSegment(StringBuilder sb, boolean quoted)
public final String asPathString(boolean quote)
public boolean isLastPath()
public FieldSegment getChild()
protected abstract int segmentHashCode()
protected abstract boolean segmentEquals(FieldSegment other)
public int compareTo(FieldSegment other)
compareTo
in interface Comparable<FieldSegment>
public boolean contains(FieldSegment otherSeg)
otherSeg
- Path segment to check if it is contained below this oneCopyright © 2015–2019 MapR Technologies, Inc.. All rights reserved.