com.datastax.driver.dse.graph

## Interface GraphNode

• All Superinterfaces:
Node

public interface GraphNode
extends Node
A node in a tree-like structure representing a Graph or a Graph component. It contains additional methods that perform conversion to Graph elements (vertex, edge, etc.).
• ### Property Summary

All Methods
Type Property and Description
Property as
Returns this node as a Property.
VertexProperty asVertex
Returns this node as a VertexProperty.
• ### Method Summary

All Methods
Modifier and Type Method and Description
Edge asEdge()
Returns this node as an Edge.
Path asPath()
Returns this node as a Path.
Property asProperty()
Returns this node as a Property.
Vertex asVertex()
Returns this node as a Vertex.
VertexProperty asVertexProperty()
Returns this node as a VertexProperty.
GraphNode get(int index)
Returns the element node at the specified index of an array node.
GraphNode get(String fieldName)
Returns the value of the specified field of an object node.
boolean isEdge()
Returns true if this node is an edge.
boolean isVertex()
Returns true if this node is a vertex.
• ### Methods inherited from interface com.datastax.driver.dse.serde.Node

as, as, asBoolean, asDouble, asInt, asLong, asMap, asString, fieldNames, isArray, isNull, isObject, isValue, size

• ### Method Detail

• #### get

GraphNode get(String fieldName)
Description copied from interface: Node
Returns the value of the specified field of an object node.

If this node is not an object (or it does not have a value for the specified field name), or if there is no field with such name, null is returned.

If the property value has been explicitly set to null, implementors may return a special "null node" instead of null.

Specified by:
get in interface Node
Parameters:
fieldName - the field name to fetch.
Returns:
a node containing the requested field value, or null if it does not exist.
• #### get

GraphNode get(int index)
Description copied from interface: Node
Returns the element node at the specified index of an array node.

For all other node types, null is returned.

If 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.

Specified by:
get in interface Node
Parameters:
index - the element index to fetch.
Returns:
a node containing the requested element, or null if it does not exist.
• #### isVertex

boolean isVertex()
Returns true if this node is a vertex. If this node is a vertex, then asVertex() can be safely called.
Returns:
true if this node is a vertex, false otherwise.
• #### isEdge

boolean isEdge()
Returns true if this node is an edge. If this node is an edge, then asEdge() can be safely called.
Returns:
true if this node is an edge, false otherwise.
• #### asProperty

Property asProperty()
Returns this node as a Property.
• #### asVertexProperty

VertexProperty asVertexProperty()
Returns this node as a VertexProperty.