org.apache.tinkerpop.gremlin.structure.util.detached

## Class DetachedEdge

- java.lang.Object
- - org.apache.tinkerpop.gremlin.structure.util.detached.DetachedElement<Edge>
  - - org.apache.tinkerpop.gremlin.structure.util.detached.DetachedEdge

- All Implemented Interfaces:
    Serializable, Edge, Element, Attachable<Edge>

      public class DetachedEdge
      extends DetachedElement<Edge>
      implements Edge

  Represents an `Edge` that is disconnected from a `Graph`. "Disconnection" can mean detachment from a `Graph` in the sense that the `Edge` was constructed from a `Graph` instance and this reference was removed or it can mean that the `DetachedEdge` could have been constructed independently of a `Graph` instance in the first place.

  A `DetachedEdge` only has reference to the properties and in/out vertices that are associated with it at the time of detachment (or construction) and is not traversable or mutable. Note that the references to the in/out vertices are `DetachedVertex` instances that only have reference to the `Element.id()` and `Element.label()`.
  Author:
    Stephen Mallette (http://stephen.genoprime.com), Marko A. Rodriguez (http://markorodriguez.com)
  See Also:
    Serialized Form

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `DetachedEdge.Builder`

    - ### Nested classes/interfaces inherited from interface org.apache.tinkerpop.gremlin.structure.Edge

      `Edge.Exceptions`

    - ### Nested classes/interfaces inherited from interface org.apache.tinkerpop.gremlin.structure.util.Attachable

      `Attachable.Exceptions, Attachable.Method`

  - ### Field Summary

    - ### Fields inherited from class org.apache.tinkerpop.gremlin.structure.util.detached.DetachedElement

      `id, label, properties`

    - ### Fields inherited from interface org.apache.tinkerpop.gremlin.structure.Edge

      `DEFAULT_LABEL`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `DetachedEdge(Edge edge, boolean withProperties)`
    `` | `DetachedEdge(Object id, String label, Map<String,Object> properties, Object outVId, String outVLabel, Object inVId, String inVLabel)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static DetachedEdge.Builder` | `build()` Provides a way to construct an immutable `DetachedEdge`.
    `Vertex` | `inVertex()` Get the incoming/head vertex of this edge.
    `Vertex` | `outVertex()` Get the outgoing/tail vertex of this edge.
    `<V> Iterator<Property<V>>` | `properties(String... propertyKeys)` Get an `Iterator` of properties where the `propertyKeys` is meant to be a filter on the available keys.
    `void` | `remove()` Removes the `Element` from the graph.
    `String` | `toString()`
    `Iterator<Vertex>` | `vertices(Direction direction)` Retrieve the vertex (or vertices) associated with this edge as defined by the direction.

    - ### Methods inherited from class org.apache.tinkerpop.gremlin.structure.util.detached.DetachedElement

      `equals, get, graph, hashCode, id, label, property, property`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface org.apache.tinkerpop.gremlin.structure.Edge

      `bothVertices`

    - ### Methods inherited from interface org.apache.tinkerpop.gremlin.structure.Element

      `graph, id, keys, label, property, property, value, values`

    - ### Methods inherited from interface org.apache.tinkerpop.gremlin.structure.util.Attachable

      `attach`

- - ### Constructor Detail

    - #### DetachedEdge

          protected DetachedEdge(Edge edge,
                                 boolean withProperties)

    - #### DetachedEdge

          public DetachedEdge(Object id,
                              String label,
                              Map<String,Object> properties,
                              Object outVId,
                              String outVLabel,
                              Object inVId,
                              String inVLabel)

  - ### Method Detail

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### inVertex

          public Vertex inVertex()

      Description copied from interface: `Edge`
      Get the incoming/head vertex of this edge.
      Specified by:
        `inVertex` in interface `Edge`
      Returns:
        the incoming vertex of the edge

    - #### outVertex

          public Vertex outVertex()

      Description copied from interface: `Edge`
      Get the outgoing/tail vertex of this edge.
      Specified by:
        `outVertex` in interface `Edge`
      Returns:
        the outgoing vertex of the edge

    - #### vertices

          public Iterator<Vertex> vertices(Direction direction)

      Description copied from interface: `Edge`
      Retrieve the vertex (or vertices) associated with this edge as defined by the direction. If the direction is `Direction.BOTH` then the iterator order is: `Direction.OUT` then `Direction.IN`.
      Specified by:
        `vertices` in interface `Edge`
      Parameters:
        `direction` - Get the incoming vertex, outgoing vertex, or both vertices
      Returns:
        An iterator with 1 or 2 vertices

    - #### remove

          public void remove()

      Description copied from interface: `Element`
      Removes the `Element` from the graph.
      Specified by:
        `remove` in interface `Element`

    - #### properties

          public <V> Iterator<Property<V>> properties(String... propertyKeys)

      Description copied from interface: `Element`
      Get an `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.
      Specified by:
        `properties` in interface `Edge`
      Specified by:
        `properties` in interface `Element`
      Overrides:
        `properties` in class `DetachedElement<Edge>`

    - #### build

          public static DetachedEdge.Builder build()

      Provides a way to construct an immutable `DetachedEdge`.

Copyright © 2013–2022 Apache Software Foundation. All rights reserved.