Class DetachedVertex
java.lang.Object
org.apache.tinkerpop.gremlin.structure.util.detached.DetachedElement<Vertex>
org.apache.tinkerpop.gremlin.structure.util.detached.DetachedVertex
- All Implemented Interfaces:
Serializable,Element,Attachable<Vertex>,Host,Vertex
Represents a
Vertex that is disconnected from a Graph. "Disconnection" can mean detachment from
a Graph in the sense that a Vertex was constructed from a Graph instance and this reference
was removed or it can mean that the DetachedVertex could have been constructed independently of a
Graph instance in the first place.
A DetachedVertex only has reference to the properties that are associated with it at the time of detachment
(or construction) and is not traversable or mutable.- Author:
- Stephen Mallette (http://stephen.genoprime.com), Marko A. Rodriguez (http://markorodriguez.com)
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface org.apache.tinkerpop.gremlin.structure.util.Attachable
Attachable.Exceptions, Attachable.MethodNested classes/interfaces inherited from interface org.apache.tinkerpop.gremlin.structure.Element
Element.ExceptionsNested classes/interfaces inherited from interface org.apache.tinkerpop.gremlin.structure.Vertex
Vertex.Exceptions -
Field Summary
FieldsFields inherited from class org.apache.tinkerpop.gremlin.structure.util.detached.DetachedElement
id, label, propertiesFields inherited from interface org.apache.tinkerpop.gremlin.structure.util.Attachable
loggerFields inherited from interface org.apache.tinkerpop.gremlin.structure.Vertex
DEFAULT_LABEL, EMPTY_ARGS -
Constructor Summary
ConstructorsModifierConstructorDescriptionDetachedVertex(Object id, String label, List<VertexProperty> properties) protectedDetachedVertex(Vertex vertex, boolean withProperties) -
Method Summary
Modifier and TypeMethodDescriptionAdd an outgoing edge to the vertex with provided label and edge properties as key/value pairs.static DetachedVertex.Builderbuild()Provides a way to construct an immutableDetachedVertex.Gets anIteratorof incident edges.label()Gets the label for the graphElementwhich helps categorize it.labels()Gets all labels for this element.<V> Iterator<VertexProperty<V>>properties(String... propertyKeys) Get anIteratorof properties where thepropertyKeysis meant to be a filter on the available keys.<V> VertexProperty<V>Get aPropertyfor theElementgiven its key.<V> VertexProperty<V>Add or set a property value for theElementgiven its key.<V> VertexProperty<V>Set the provided key to the provided value using defaultVertexProperty.Cardinalityfor that key.<V> VertexProperty<V>property(VertexProperty.Cardinality cardinality, String key, V value, Object... keyValues) Create a new vertex property.voidremove()Removes theElementfrom the graph.toString()Gets anIteratorof adjacent vertices.Methods inherited from class org.apache.tinkerpop.gremlin.structure.util.detached.DetachedElement
equals, get, graph, hashCode, idMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.tinkerpop.gremlin.structure.util.Attachable
attach
-
Field Details
-
vertexLabels
-
-
Constructor Details
-
DetachedVertex
-
DetachedVertex
-
DetachedVertex
-
-
Method Details
-
label
Description copied from interface:ElementGets the label for the graphElementwhich helps categorize it.- Specified by:
labelin interfaceElement- Overrides:
labelin classDetachedElement<Vertex>- Returns:
- The label of the element
-
labels
Description copied from interface:ElementGets all labels for this element.For
Vertex: may return zero or more labels (multi-label support). ForEdge: returns a singleton set (single label only in TinkerGraph). ForVertexProperty: returns a singleton set containing the property key. -
property
Description copied from interface:ElementAdd or set a property value for theElementgiven its key.- Specified by:
propertyin interfaceElement- Specified by:
propertyin interfaceVertex- Overrides:
propertyin classDetachedElement<Vertex>- Type Parameters:
V- the type of the value of the vertex property- Parameters:
key- the key of the vertex propertyvalue- The value of the vertex property- Returns:
- the newly created vertex property
-
property
Description copied from interface:VertexSet the provided key to the provided value using defaultVertexProperty.Cardinalityfor that key. The default cardinality can be vendor defined and is usually tied to the graph schema. The default implementation of this method determines the cardinalitygraph().features().vertex().getCardinality(key). The provided key/values are the properties of the newly createdVertexProperty. These key/values must be provided in an even number where the odd numbered arguments areString.- Specified by:
propertyin interfaceVertex- Type Parameters:
V- the type of the value of the vertex property- Parameters:
key- the key of the vertex propertyvalue- The value of the vertex propertykeyValues- the key/value pairs to turn into vertex property properties- Returns:
- the newly created vertex property
-
property
public <V> VertexProperty<V> property(VertexProperty.Cardinality cardinality, String key, V value, Object... keyValues) Description copied from interface:VertexCreate a new vertex property. If the cardinality isVertexProperty.Cardinality.single, then set the key to the value. If the cardinality isVertexProperty.Cardinality.list, then add a new value to the key. If the cardinality isVertexProperty.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.- Specified by:
propertyin interfaceVertex- Type Parameters:
V- the type of the value of the vertex property- Parameters:
cardinality- 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 properties- Returns:
- the newly created vertex property
-
property
Description copied from interface:ElementGet aPropertyfor theElementgiven its key. The default implementation calls the rawElement.properties(java.lang.String...).- Specified by:
propertyin interfaceElement- Specified by:
propertyin interfaceVertex- Overrides:
propertyin classDetachedElement<Vertex>- Type Parameters:
V- the expected type of the vertex property value- Parameters:
key- the key of the vertex property to get- Returns:
- the retrieved vertex property
-
addEdge
Description copied from interface:VertexAdd an outgoing edge to the vertex with provided label and edge properties as key/value pairs. These key/values must be provided in an even number where the odd numbered arguments areStringproperty keys and the even numbered arguments are the related property values. -
toString
-
properties
Description copied from interface:ElementGet anIteratorof properties where thepropertyKeysis meant to be a filter on the available keys. If no keys are provide then return all the properties.- Specified by:
propertiesin interfaceElement- Specified by:
propertiesin interfaceVertex- Overrides:
propertiesin classDetachedElement<Vertex>
-
edges
Description copied from interface:VertexGets anIteratorof incident edges. -
vertices
Description copied from interface:VertexGets anIteratorof adjacent vertices.- Specified by:
verticesin interfaceVertex- Parameters:
direction- The adjacency direction of the vertices to retrieve off this vertexlabels- The labels of the edges associated with the vertices to retrieve. If no labels are provided, then get all edges.- Returns:
- An iterator of vertices meeting the provided specification
-
remove
public void remove()Description copied from interface:ElementRemoves theElementfrom the graph. -
build
Provides a way to construct an immutableDetachedVertex.
-