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 areUUID
objects. This behavior can be overridden by setting theElementIdStrategy.Builder.idMaker(Supplier)
. Unless otherwise specified the identifier is stored in the__id
property. This can be changed by setting theElementIdStrategy.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 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 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 Description void
apply(Traversal.Admin<?,?> traversal)
static ElementIdStrategy.Builder
build()
static ElementIdStrategy
create(org.apache.commons.configuration2.Configuration configuration)
org.apache.commons.configuration2.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
applyPost, applyPrior
-
Methods inherited from interface org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy.DecorationStrategy
compareTo, getTraversalCategory
-
-
-
-
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()
-
apply
public void apply(Traversal.Admin<?,?> traversal)
- Specified by:
apply
in interfaceTraversalStrategy<TraversalStrategy.DecorationStrategy>
-
build
public static ElementIdStrategy.Builder build()
-
toString
public String toString()
- Overrides:
toString
in classAbstractTraversalStrategy<TraversalStrategy.DecorationStrategy>
-
create
public static ElementIdStrategy create(org.apache.commons.configuration2.Configuration configuration)
-
getConfiguration
public org.apache.commons.configuration2.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 interfaceTraversalStrategy<TraversalStrategy.DecorationStrategy>
- Returns:
- the configuration used to create this strategy
-
-