public interface GraphNode
It can be:
as(Class)
and as(GenericType)
can produce any arbitrary Java type, provided that the underlying serialization
runtime has been correctly configured to support the requested conversion.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(GenericType<ResultT> type)
Deserializes and returns this node as an instance of the given
type . |
boolean |
asBoolean()
Returns this node as a boolean.
|
double |
asDouble()
Returns this node as a long integer.
|
org.apache.tinkerpop.gremlin.structure.Edge |
asEdge()
Returns this node as a Tinkerpop
Edge . |
int |
asInt()
Returns this node as an integer.
|
<T> List<T> |
asList()
Deserializes and returns this node as a
List . |
long |
asLong()
Returns this node as a long integer.
|
<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.
|
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 . |
GraphNode |
getByIndex(int index)
Returns the element at the given index as a node.
|
GraphNode |
getByKey(Object key)
Returns the value for the given key as a node.
|
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. |
boolean isNull()
null
value.boolean isMap()
true
if this node is a Map
, and false
otherwise.
If this method returns true
, you can convert this node with asMap()
, or use
keys()
and getByKey(Object)
to access the individual fields (note that
entries are not ordered, so getByIndex(int)
does not work).
Iterable<?> keys()
GraphNode getByKey(Object key)
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
.
boolean isList()
true
if this node is a List
, and false
otherwise.
If this method returns true
, you can convert this node with asList()
, or
use size()
and getByIndex(int)
to access the individual fields.
int size()
0
otherwise.GraphNode getByIndex(int index)
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
.
boolean isValue()
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 asString()
,
asBoolean()
, asInt()
, asLong()
or asDouble()
.
int asInt()
If the underlying object is not convertible to integer, implementors may choose to either
throw ClassCastException
or return [null | empty | some default value], whichever is
deemed more appropriate.
boolean asBoolean()
If the underlying object is not convertible to boolean, implementors may choose to either
throw ClassCastException
or return [null | empty | some default value], whichever is
deemed more appropriate.
long asLong()
If the underlying object is not convertible to long, implementors may choose to either throw
ClassCastException
or return [null | empty | some default value], whichever is deemed
more appropriate.
double asDouble()
If the underlying object is not convertible to double, implementors may choose to either
throw ClassCastException
or return [null | empty | some default value], whichever is
deemed more appropriate.
String asString()
If the underlying object is not convertible to a string, implementors may choose to either
throw ClassCastException
or return an empty string, whichever is deemed more
appropriate.
<ResultT> ResultT as(Class<ResultT> clazz)
clazz
.
Before attempting such a conversion, there must be an appropriate converter configured on the underlying serialization runtime.
<ResultT> ResultT as(GenericType<ResultT> type)
type
.
Before attempting such a conversion, there must be an appropriate converter configured on the underlying serialization runtime.
boolean isVertex()
true
if this node is a Vertex
, and false
otherwise.
If this method returns true
, then asVertex()
can be safely called.
org.apache.tinkerpop.gremlin.structure.Vertex asVertex()
Vertex
.boolean isEdge()
true
if this node is a Edge
, and false
otherwise.
If this method returns true
, then asEdge()
can be safely called.
org.apache.tinkerpop.gremlin.structure.Edge asEdge()
Edge
.boolean isPath()
true
if this node is a Path
, and false
otherwise.
If this method returns true
, then asPath()
can be safely called.
org.apache.tinkerpop.gremlin.process.traversal.Path asPath()
Path
.boolean isProperty()
true
if this node is a Property
, and false
otherwise.
If this method returns true
, then asProperty()
can be safely called.
<T> org.apache.tinkerpop.gremlin.structure.Property<T> asProperty()
Property
.boolean isVertexProperty()
true
if this node is a VertexProperty
, and false
otherwise.
If this method returns true
, then asVertexProperty()
()} can be safely
called.
<T> org.apache.tinkerpop.gremlin.structure.VertexProperty<T> asVertexProperty()
VertexProperty
.boolean isSet()
Copyright © 2017–2020. All rights reserved.