Constructor and Description |
---|
LegacyGraphNode(org.apache.tinkerpop.shaded.jackson.databind.JsonNode delegate,
org.apache.tinkerpop.shaded.jackson.databind.ObjectMapper objectMapper) |
Modifier and Type | Method and Description |
---|---|
<ResultT> ResultT |
as(Class<ResultT> clazz)
Deserializes and returns this node as an instance of
clazz . |
<ResultT> ResultT |
as(com.datastax.oss.driver.api.core.type.reflect.GenericType<ResultT> type)
Deserializes and returns this node as an instance of the given
type . |
boolean |
asBoolean()
This node as a boolean, or
false if it can't be converted. |
double |
asDouble()
Returns this node as a long integer, or
0.0D if it can't be converted. |
org.apache.tinkerpop.gremlin.structure.Edge |
asEdge()
Returns this node as a Tinkerpop
Edge . |
int |
asInt()
This node as an integer, or
0 if it can't be converted. |
<T> List<T> |
asList()
Deserializes and returns this node as a
List . |
long |
asLong()
Returns this node as a long integer, or
0L if it can't be converted. |
<K,V> Map<K,V> |
asMap()
Deserializes and returns this node as a
Map . |
org.apache.tinkerpop.gremlin.process.traversal.Path |
asPath()
Returns this node as a Tinkerpop
Path . |
<T> org.apache.tinkerpop.gremlin.structure.Property<T> |
asProperty()
Returns this node as a Tinkerpop
Property . |
<T> Set<T> |
asSet()
Deserializes and returns this node as a
Set . |
String |
asString()
A valid string representation of this node, if the node is a simple node (i.e.
|
org.apache.tinkerpop.gremlin.structure.Vertex |
asVertex()
Returns this node as a Tinkerpop
Vertex . |
<T> org.apache.tinkerpop.gremlin.structure.VertexProperty<T> |
asVertexProperty()
Returns this node as a Tinkerpop
VertexProperty . |
boolean |
equals(Object o) |
LegacyGraphNode |
getByIndex(int index)
Returns the element at the given index as a node.
|
LegacyGraphNode |
getByKey(Object key)
Returns the value for the given key as a node.
|
org.apache.tinkerpop.shaded.jackson.databind.JsonNode |
getDelegate()
The underlying JSON representation.
|
org.apache.tinkerpop.shaded.jackson.databind.ObjectMapper |
getObjectMapper()
The object mapper used to deserialize results in
as(Class) and as(GenericType) . |
int |
hashCode() |
boolean |
isEdge()
Returns
true if this node is a Edge , and false otherwise. |
boolean |
isList()
|
boolean |
isMap()
|
boolean |
isNull()
Whether this node represents a
null value. |
boolean |
isPath()
Returns
true if this node is a Path , and false otherwise. |
boolean |
isProperty()
Returns
true if this node is a Property , and false otherwise. |
boolean |
isSet()
|
boolean |
isValue()
Returns
true if this node is a simple scalar value, (i.e., string, boolean or number),
and false otherwise. |
boolean |
isVertex()
Returns
true if this node is a Vertex , and false otherwise. |
boolean |
isVertexProperty()
Returns
true if this node is a VertexProperty , and false otherwise. |
Iterable<?> |
keys()
The keys of this map node, or an empty iterator if it is not a map.
|
int |
size()
The size of the current node, if it is a list or map, or
0 otherwise. |
String |
toString() |
public LegacyGraphNode(org.apache.tinkerpop.shaded.jackson.databind.JsonNode delegate, org.apache.tinkerpop.shaded.jackson.databind.ObjectMapper objectMapper)
public org.apache.tinkerpop.shaded.jackson.databind.JsonNode getDelegate()
This is an implementation detail, it's only exposed through the internal API.
public org.apache.tinkerpop.shaded.jackson.databind.ObjectMapper getObjectMapper()
as(Class)
and as(GenericType)
.
This is an implementation detail, it's only exposed through the internal API.
public boolean isNull()
GraphNode
null
value.public boolean isMap()
GraphNode
true
if this node is a Map
, and false
otherwise.
If this method returns true
, you can convert this node with GraphNode.asMap()
, or use
GraphNode.keys()
and GraphNode.getByKey(Object)
to access the individual fields (note that
entries are not ordered, so GraphNode.getByIndex(int)
does not work).
public Iterable<?> keys()
GraphNode
public LegacyGraphNode getByKey(Object key)
GraphNode
If this node is not a map, or does not contain the specified key, null
is returned.
If the property value has been explicitly set to null
, implementors may return a
special "null node" instead of null
.
public <K,V> Map<K,V> asMap()
GraphNode
Map
.public boolean isList()
GraphNode
true
if this node is a List
, and false
otherwise.
If this method returns true
, you can convert this node with GraphNode.asList()
, or
use GraphNode.size()
and GraphNode.getByIndex(int)
to access the individual fields.
public int size()
GraphNode
0
otherwise.public LegacyGraphNode getByIndex(int index)
GraphNode
If this node is not a list, or index
is out of bounds (i.e. less than zero or >= size()
, null
is returned; no exception will be thrown.
If the requested element has been explicitly set to null
, implementors may return a
special "null node" instead of null
.
getByIndex
in interface GraphNode
public <T> List<T> asList()
GraphNode
List
.public boolean isValue()
GraphNode
true
if this node is a simple scalar value, (i.e., string, boolean or number),
and false
otherwise.
If this method returns true
, you can convert this node with GraphNode.asString()
,
GraphNode.asBoolean()
, GraphNode.asInt()
, GraphNode.asLong()
or GraphNode.asDouble()
.
public int asInt()
GraphNode
0
if it can't be converted.
This method never throws; even incompatible objects (including null
and structured
types like objects and arrays) are converted to the default value.
public boolean asBoolean()
GraphNode
false
if it can't be converted.
This method never throws; even incompatible objects (including null
and structured
types like objects and arrays) are converted to the default value.
public long asLong()
GraphNode
0L
if it can't be converted.
This method never throws; even incompatible objects (including null
and structured
types like objects and arrays) are converted to the default value.
public double asDouble()
GraphNode
0.0D
if it can't be converted.
This method never throws; even incompatible objects (including null
and structured
types like objects and arrays) are converted to the default value.
public String asString()
GraphNode
This method never throws; even incompatible objects (including null
and structured
types like objects and arrays) are converted to the default value.
public boolean isVertex()
GraphNode
true
if this node is a Vertex
, and false
otherwise.
If this method returns true
, then GraphNode.asVertex()
can be safely called.
public org.apache.tinkerpop.gremlin.structure.Vertex asVertex()
GraphNode
Vertex
.public boolean isEdge()
GraphNode
true
if this node is a Edge
, and false
otherwise.
If this method returns true
, then GraphNode.asEdge()
can be safely called.
public org.apache.tinkerpop.gremlin.structure.Edge asEdge()
GraphNode
Edge
.public boolean isPath()
GraphNode
true
if this node is a Path
, and false
otherwise.
If this method returns true
, then GraphNode.asPath()
can be safely called.
public org.apache.tinkerpop.gremlin.process.traversal.Path asPath()
GraphNode
Path
.public boolean isProperty()
GraphNode
true
if this node is a Property
, and false
otherwise.
If this method returns true
, then GraphNode.asProperty()
can be safely called.
isProperty
in interface GraphNode
public <T> org.apache.tinkerpop.gremlin.structure.Property<T> asProperty()
GraphNode
Property
.asProperty
in interface GraphNode
public boolean isVertexProperty()
GraphNode
true
if this node is a VertexProperty
, and false
otherwise.
If this method returns true
, then GraphNode.asVertexProperty()
()} can be safely
called.
isVertexProperty
in interface GraphNode
public <T> org.apache.tinkerpop.gremlin.structure.VertexProperty<T> asVertexProperty()
GraphNode
VertexProperty
.asVertexProperty
in interface GraphNode
public boolean isSet()
GraphNode
true
if this node is a Set
, and false
otherwise.
If this method returns true
, you can convert this node with GraphNode.asSet()
, or use
GraphNode.size()
.
public <T> Set<T> asSet()
GraphNode
Set
.public <ResultT> ResultT as(Class<ResultT> clazz)
GraphNode
clazz
.
Before attempting such a conversion, there must be an appropriate converter configured on the underlying serialization runtime.
public <ResultT> ResultT as(com.datastax.oss.driver.api.core.type.reflect.GenericType<ResultT> type)
GraphNode
type
.
Before attempting such a conversion, there must be an appropriate converter configured on the underlying serialization runtime.
Copyright © 2017–2019. All rights reserved.