org.apache.tinkerpop.gremlin.neo4j.structure

## Class Neo4jVertex

- java.lang.Object
- - org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jElement
  - - org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jVertex

- All Implemented Interfaces:
    Element, Host, WrappedElement<Neo4jEntity>, WrappedVertex<Neo4jNode>, Vertex

      public final class Neo4jVertex
      extends Neo4jElement
      implements Vertex, WrappedVertex<Neo4jNode>

  Author:
    Stephen Mallette (http://stephen.genoprime.com)

- - ### Nested Class Summary

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

      `Vertex.Exceptions`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `LABEL_DELIMINATOR`

    - ### Fields inherited from class org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jElement

      `baseElement, graph`

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

      `DEFAULT_LABEL, EMPTY_ARGS`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Neo4jVertex(Neo4jNode node, Neo4jGraph graph)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    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.

    - ### Methods inherited from class org.apache.tinkerpop.gremlin.neo4j.structure.Neo4jElement

      `equals, getBaseElement, graph, hashCode, id, keys`

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

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

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

      `property`

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

      `graph, id, keys, value, values`

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

      `getHostingVertex`

- - ### Field Detail

    - #### LABEL_DELIMINATOR

          public static final String LABEL_DELIMINATOR

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### Neo4jVertex

          public Neo4jVertex(Neo4jNode node,
                             Neo4jGraph graph)

  - ### Method Detail

    - #### addEdge

          public Edge addEdge(String label,
                              Vertex inVertex,
                              Object... keyValues)

      Description copied from interface: `Vertex`
      Add 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 are `String` property keys and the even numbered arguments are the related property values.
      Specified by:
        `addEdge` in interface `Vertex`
      Parameters:
        `label` - The label of the edge
        `inVertex` - The vertex to receive an incoming edge from the current vertex
        `keyValues` - The key/value pairs to turn into edge properties
      Returns:
        the newly created edge

    - #### property

          public <V> VertexProperty<V> property(String key,
                                                V value)

      Description copied from interface: `Vertex`
      Set the provided key to the provided value using `VertexProperty.Cardinality.single`.
      Specified by:
        `property` in interface `Element`
      Specified by:
        `property` in interface `Vertex`
      Type Parameters:
        `V` - the type of the value of the vertex property
      Parameters:
        `key` - the key of the vertex property
        `value` - The value of the vertex property
      Returns:
        the newly created vertex property

    - #### remove

          public void remove()

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

    - #### property

          public <V> VertexProperty<V> property(VertexProperty.Cardinality cardinality,
                                                String key,
                                                V value,
                                                Object... keyValues)

      Description copied from interface: `Vertex`
      Create a new vertex property. If the cardinality is `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.
      Specified by:
        `property` in interface `Vertex`
      Type Parameters:
        `V` - the type of the value of the vertex property
      Parameters:
        `cardinality` - the desired cardinality of the property key
        `key` - the key of the vertex property
        `value` - The value of the vertex property
        `keyValues` - the key/value pairs to turn into vertex property properties
      Returns:
        the newly created vertex property

    - #### property

          public <V> VertexProperty<V> property(String key)

      Description copied from interface: `Vertex`
      Get the `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)`.
      Specified by:
        `property` in interface `Element`
      Specified by:
        `property` in interface `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

    - #### properties

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

      Description copied from interface: `Vertex`
      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 `Element`
      Specified by:
        `properties` in interface `Vertex`

    - #### getBaseVertex

          public Neo4jNode getBaseVertex()

      Specified by:
        `getBaseVertex` in interface `WrappedVertex<Neo4jNode>`

    - #### label

          public String label()

      Description copied from interface: `Element`
      Gets the label for the graph `Element` which helps categorize it.
      Specified by:
        `label` in interface `Element`
      Returns:
        The label of the element

    - #### vertices

          public Iterator<Vertex> vertices(Direction direction,
                                           String... edgeLabels)

      Description copied from interface: `Vertex`
      Gets an `Iterator` of adjacent vertices.
      Specified by:
        `vertices` in interface `Vertex`
      Parameters:
        `direction` - The adjacency direction of the vertices to retrieve off this vertex
        `edgeLabels` - 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

    - #### edges

          public Iterator<Edge> edges(Direction direction,
                                      String... edgeLabels)

      Description copied from interface: `Vertex`
      Gets an `Iterator` of incident edges.
      Specified by:
        `edges` in interface `Vertex`
      Parameters:
        `direction` - The incident direction of the edges to retrieve off this vertex
        `edgeLabels` - The labels of the edges to retrieve. If no labels are provided, then get all edges.
      Returns:
        An iterator of edges meeting the provided specification

    - #### labels

          public Set<String> labels()

    - #### addLabel

          public void addLabel(String label)

    - #### removeLabel

          public void removeLabel(String label)

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

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