org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration

## Class ElementIdStrategy

- java.lang.Object
- - org.apache.tinkerpop.gremlin.process.traversal.strategy.AbstractTraversalStrategy<TraversalStrategy.DecorationStrategy>
  - - org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.ElementIdStrategy

- All Implemented Interfaces:
    Serializable, Comparable<Class<? extends TraversalStrategy>>, TraversalStrategy<TraversalStrategy.DecorationStrategy>, TraversalStrategy.DecorationStrategy

      public final class ElementIdStrategy
      extends AbstractTraversalStrategy<TraversalStrategy.DecorationStrategy>
      implements TraversalStrategy.DecorationStrategy

  Provides a degree of control over element identifier assignment as some graphs don't provide that feature. This strategy provides for identifier assignment by enabling users to utilize vertex and edge indices under the hood, thus simulating that capability.

  By default, when an identifier is not supplied by the user, newly generated identifiers are `UUID` objects. This behavior can be overridden by setting the `ElementIdStrategy.Builder.idMaker(Supplier)`.

  Unless otherwise specified the identifier is stored in the `__id` property. This can be changed by setting the `ElementIdStrategy.Builder.idPropertyKey(String)`
  Author:
    Marko A. Rodriguez (http://markorodriguez.com), Stephen Mallette (http://stephen.genoprime.com)
  See Also:
    Serialized Form

- - ### Nested Class Summary

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

    - ### Nested classes/interfaces inherited from interface org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy

      `TraversalStrategy.DecorationStrategy, TraversalStrategy.FinalizationStrategy, TraversalStrategy.OptimizationStrategy, TraversalStrategy.ProviderOptimizationStrategy, TraversalStrategy.VerificationStrategy`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `ID_MAKER`
    `static String` | `ID_PROPERTY_KEY`

    - ### Fields inherited from interface org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy

      `STRATEGY`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `apply(Traversal.Admin<?,?> traversal)`
    `static ElementIdStrategy.Builder` | `build()`
    `static ElementIdStrategy` | `create(Configuration configuration)`
    `Configuration` | `getConfiguration()` Get the configuration representation of this strategy.
    `Supplier<Object>` | `getIdMaker()`
    `String` | `getIdPropertyKey()`
    `String` | `toString()`

    - ### Methods inherited from class org.apache.tinkerpop.gremlin.process.traversal.strategy.AbstractTraversalStrategy

      `equals, hashCode`

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

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

    - ### Methods inherited from interface org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy.DecorationStrategy

      `compareTo, getTraversalCategory`

    - ### Methods inherited from interface org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy

      `applyPost, applyPrior`

- - ### Field Detail

    - #### ID_PROPERTY_KEY

          public static final String ID_PROPERTY_KEY

      See Also:
        Constant Field Values

    - #### ID_MAKER

          public static final String ID_MAKER

      See Also:
        Constant Field Values

  - ### Method Detail

    - #### getIdPropertyKey

          public String getIdPropertyKey()

    - #### getIdMaker

          public Supplier<Object> getIdMaker()

    - #### apply

          public void apply(Traversal.Admin<?,?> traversal)

      Specified by:
        `apply` in interface `TraversalStrategy<TraversalStrategy.DecorationStrategy>`

    - #### build

          public static ElementIdStrategy.Builder build()

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `AbstractTraversalStrategy<TraversalStrategy.DecorationStrategy>`

    - #### create

          public static ElementIdStrategy create(Configuration configuration)

    - #### getConfiguration

          public Configuration getConfiguration()

      Description copied from interface: `TraversalStrategy`
      Get the configuration representation of this strategy. This is useful for converting a strategy into a serialized form.
      Specified by:
        `getConfiguration` in interface `TraversalStrategy<TraversalStrategy.DecorationStrategy>`
      Returns:
        the configuration used to create this strategy

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