@groovy.util.logging.Slf4j class EdgeBuilder extends PropertyValuesHolder<EdgeBuilder>
Builder class used when creating edges from an EdgeDefinition object.
Type | Name and description |
---|---|
EdgeDefinition |
edgeDef The edge definition that will be used to create edges. |
org.apache.tinkerpop.gremlin.structure.Vertex |
fromVertex The from or out vertex for created edges |
org.apache.tinkerpop.gremlin.structure.Vertex |
toVertex The to or in vertex for created edges |
Constructor and description |
---|
EdgeBuilder
(EdgeDefinition edgeDef) Constructor that takes the edge definition as an argument. |
Type Params | Return Type | Name and description |
---|---|---|
|
void |
assertRequiredProperties() Assert that the properties required by the edge definition have been set. |
|
org.apache.tinkerpop.gremlin.structure.Edge |
create() Create new edge using previously specified 'from' and 'to' Vertex objects. |
|
org.apache.tinkerpop.gremlin.structure.Edge |
ensure(org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource g) If the edge with the specified 'from', 'to', and properties exists return it, otherwise create it. |
|
EdgeBuilder |
from(org.apache.tinkerpop.gremlin.structure.Vertex v) Sets the from vertex for created edges. |
|
ElementDefinition |
getElementDef() Return the element element definition of this builder. |
|
EdgeBuilder |
to(org.apache.tinkerpop.gremlin.structure.Vertex v) Sets the to vertex for created edges. |
|
java.lang.String |
toString() Convenience string representation of this object. |
The edge definition that will be used to create edges.
The from or out vertex for created edges
The to or in vertex for created edges
Constructor that takes the edge definition as an argument.
edgeDef
- The edge definition this builder will use.Assert that the properties required by the edge definition have been set.
Create new edge using previously specified 'from' and 'to' Vertex objects. Usage example, assuming EX.IS_FIRENDS_WITH is an enum decorated with '@EdgeModel':
Edge edge1 = EX.IS_FRIENDS_WITH.instance().from(person1).to(person2).create()
If the edge with the specified 'from', 'to', and properties exists return it, otherwise create it. Usage example, assuming EX.IS_FIRENDS_WITH is an enum decorated with '@EdgeModel':
Edge edge1 = EX.IS_FRIENDS_WITH.instance().from(person1).to(person2).ensure()
Sets the from vertex for created edges.
v
- The from vertexReturn the element element definition of this builder.
Sets the to vertex for created edges.
v
- The to vertexConvenience string representation of this object.
Groovy Documentation