public final class Neo4jVertex extends Neo4jElement implements Vertex, WrappedVertex<Neo4jNode>
Vertex.Exceptions
Modifier and Type | Field and Description |
---|---|
static String |
LABEL_DELIMINATOR |
baseElement, graph
DEFAULT_LABEL, EMPTY_ARGS
Constructor and Description |
---|
Neo4jVertex(Neo4jNode node,
Neo4jGraph graph) |
Modifier and Type | Method and Description |
---|---|
Edge |
addEdge(String label,
Vertex inVertex,
Object... keyValues)
Add an outgoing edge to the vertex with provided label and edge properties as key/value pairs.
|
void |
addLabel(String label) |
Iterator<Edge> |
edges(Direction direction,
String... edgeLabels)
Gets an
Iterator of incident edges. |
Neo4jNode |
getBaseVertex() |
String |
label()
Gets the label for the graph
Element which helps categorize it. |
Set<String> |
labels() |
<V> Iterator<VertexProperty<V>> |
properties(String... propertyKeys)
Get an
Iterator of properties where the propertyKeys is meant to be a filter on the available
keys. |
<V> VertexProperty<V> |
property(String key)
Get the
VertexProperty for the provided key. |
<V> VertexProperty<V> |
property(String key,
V value)
Set the provided key to the provided value using
VertexProperty.Cardinality.single . |
<V> VertexProperty<V> |
property(VertexProperty.Cardinality cardinality,
String key,
V value,
Object... keyValues)
Create a new vertex property.
|
void |
remove()
Removes the
Element from the graph. |
void |
removeLabel(String label) |
String |
toString() |
Iterator<Vertex> |
vertices(Direction direction,
String... edgeLabels)
Gets an
Iterator of adjacent vertices. |
equals, getBaseElement, graph, hashCode, id, keys
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
graph, id, keys, value, values
getHostingVertex
public static final String LABEL_DELIMINATOR
public Neo4jVertex(Neo4jNode node, Neo4jGraph graph)
public Edge addEdge(String label, Vertex inVertex, Object... keyValues)
Vertex
String
property keys and the even numbered arguments are the related property values.public <V> VertexProperty<V> property(String key, V value)
Vertex
VertexProperty.Cardinality.single
.public void remove()
Element
Element
from the graph.public <V> VertexProperty<V> property(VertexProperty.Cardinality cardinality, String key, V value, Object... keyValues)
Vertex
VertexProperty.Cardinality.single
, then set the key
to the value. If the cardinality is VertexProperty.Cardinality.list
, then add a new value to the key.
If the cardinality is VertexProperty.Cardinality.set
, then only add a new value if that value doesn't
already exist for the key. If the value already exists for the key, add the provided key value vertex property
properties to it.property
in interface Vertex
V
- the type of the value of the vertex propertycardinality
- the desired cardinality of the property keykey
- the key of the vertex propertyvalue
- The value of the vertex propertykeyValues
- the key/value pairs to turn into vertex property propertiespublic <V> VertexProperty<V> property(String key)
Vertex
VertexProperty
for the provided key. If the property does not exist, return
VertexProperty.empty()
. If there are more than one vertex properties for the provided
key, then throw Vertex.Exceptions.multiplePropertiesExistForProvidedKey(java.lang.String)
.public <V> Iterator<VertexProperty<V>> properties(String... propertyKeys)
Vertex
Iterator
of properties where the propertyKeys
is meant to be a filter on the available
keys. If no keys are provide then return all the properties.properties
in interface Element
properties
in interface Vertex
public Neo4jNode getBaseVertex()
getBaseVertex
in interface WrappedVertex<Neo4jNode>
public String label()
Element
Element
which helps categorize it.public Iterator<Vertex> vertices(Direction direction, String... edgeLabels)
Vertex
Iterator
of adjacent vertices.vertices
in interface Vertex
direction
- The adjacency direction of the vertices to retrieve off this vertexedgeLabels
- The labels of the edges associated with the vertices to retrieve. If no labels are provided,
then get all edges.public Iterator<Edge> edges(Direction direction, String... edgeLabels)
Vertex
Iterator
of incident edges.public void addLabel(String label)
public void removeLabel(String label)
Copyright © 2013–2020 Apache Software Foundation. All rights reserved.