org.apache.tinkerpop.gremlin.tinkergraph.structure

## Class TinkerVertexProperty<V>

- java.lang.Object
- - org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerElement
  - - org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerVertexProperty<V>

- All Implemented Interfaces:
    Element, Property<V>, VertexProperty<V>

      public class TinkerVertexProperty<V>
      extends TinkerElement
      implements VertexProperty<V>

  Author:
    Marko A. Rodriguez (http://markorodriguez.com)

- - ### Nested Class Summary

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

      `VertexProperty.Cardinality, VertexProperty.Exceptions`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected Map<String,Property>` | `properties`

    - ### Fields inherited from class org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerElement

      `id, label, removed`

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

      `DEFAULT_LABEL`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TinkerVertexProperty(Object id, TinkerVertex vertex, String key, V value, Object... propertyKeyValues)` Use this constructor to construct `VertexProperty` instances for `TinkerGraph` where the `id` can be explicitly set and validated against the expected data type.
    `TinkerVertexProperty(TinkerVertex vertex, String key, V value, Object... propertyKeyValues)` This constructor will not validate the ID type against the `Graph`.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Vertex` | `element()` Gets the `Vertex` that owns this `VertexProperty`.
    `boolean` | `equals(Object object)`
    `Object` | `id()` Gets the unique identifier for the graph `Element`.
    `boolean` | `isPresent()` Whether the property is empty or not.
    `String` | `key()` The key of the property.
    `Set<String>` | `keys()` Get the keys of the properties associated with this element.
    `<U> Iterator<Property<U>>` | `properties(String... propertyKeys)` Get an `Iterator` of properties where the `propertyKeys` is meant to be a filter on the available keys.
    `<U> Property<U>` | `property(String key)` Get a `Property` for the `Element` given its key.
    `<U> Property<U>` | `property(String key, U value)` Add or set a property value for the `Element` given its key.
    `void` | `remove()` Remove the property from the associated element.
    `String` | `toString()`
    `V` | `value()` The value of the property.

    - ### Methods inherited from class org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerElement

      `elementAlreadyRemoved, hashCode, label`

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

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

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

      `empty, graph, label`

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

      `ifPresent, orElse, orElseGet, orElseThrow`

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

      `value, values`

- - ### Field Detail

    - #### properties

          protected Map<String,Property> properties

  - ### Constructor Detail

    - #### TinkerVertexProperty

          public TinkerVertexProperty(TinkerVertex vertex,
                                      String key,
                                      V value,
                                      Object... propertyKeyValues)

      This constructor will not validate the ID type against the `Graph`. It will always just use a `Long` for its identifier. This is useful for constructing a `VertexProperty` for usage with `TinkerGraphComputerView`.

    - #### TinkerVertexProperty

          public TinkerVertexProperty(Object id,
                                      TinkerVertex vertex,
                                      String key,
                                      V value,
                                      Object... propertyKeyValues)

      Use this constructor to construct `VertexProperty` instances for `TinkerGraph` where the `id` can be explicitly set and validated against the expected data type.

  - ### Method Detail

    - #### key

          public String key()

      Description copied from interface: `Property`
      The key of the property.
      Specified by:
        `key` in interface `Property<V>`
      Returns:
        The property key

    - #### value

          public V value()

      Description copied from interface: `Property`
      The value of the property.
      Specified by:
        `value` in interface `Property<V>`
      Returns:
        The property value

    - #### isPresent

          public boolean isPresent()

      Description copied from interface: `Property`
      Whether the property is empty or not.
      Specified by:
        `isPresent` in interface `Property<V>`
      Returns:
        True if the property exists, else false

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### id

          public Object id()

      Description copied from interface: `Element`
      Gets the unique identifier for the graph `Element`.
      Specified by:
        `id` in interface `Element`
      Overrides:
        `id` in class `TinkerElement`
      Returns:
        The id of the element

    - #### equals

          public boolean equals(Object object)

      Overrides:
        `equals` in class `TinkerElement`

    - #### keys

          public Set<String> keys()

      Description copied from interface: `Element`
      Get the keys of the properties associated with this element. The default implementation iterators the properties and stores the keys into a `HashSet`.
      Specified by:
        `keys` in interface `Element`
      Returns:
        The property key set

    - #### property

          public <U> Property<U> property(String key)

      Description copied from interface: `Element`
      Get a `Property` for the `Element` given its key. The default implementation calls the raw `Element.properties(java.lang.String...)`.
      Specified by:
        `property` in interface `Element`

    - #### property

          public <U> Property<U> property(String key,
                                          U value)

      Description copied from interface: `Element`
      Add or set a property value for the `Element` given its key.
      Specified by:
        `property` in interface `Element`

    - #### element

          public Vertex element()

      Description copied from interface: `VertexProperty`
      Gets the `Vertex` that owns this `VertexProperty`.
      Specified by:
        `element` in interface `Property<V>`
      Specified by:
        `element` in interface `VertexProperty<V>`
      Returns:
        The element associated with this property (i.e. `Vertex`, `Edge`, or `VertexProperty`).

    - #### remove

          public void remove()

      Description copied from interface: `Property`
      Remove the property from the associated element.
      Specified by:
        `remove` in interface `Element`
      Specified by:
        `remove` in interface `Property<V>`

    - #### properties

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

      Description copied from interface: `VertexProperty`
      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 `VertexProperty<V>`

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