public final class IdStrategy extends java.lang.Object implements GraphStrategy
GraphStrategy implementation which enables mapper element IDs even for those graphs which don't
otherwise support them.
For those graphs which support vertex indices but not edge indices (or vice versa), the strategy can be configured
to use mapper IDs only for vertices or only for edges. ID generation is also configurable via ID Supplier
functions.
If the IdStrategy is used in combination with a sequence of other strategies and when ID assignment
is enabled for an element, calls to strategies following this one are not made. It is important to consider that
aspect of its operation when doing strategy composition. Typically, the IdStrategy should be
executed last in a sequence.| Modifier and Type | Class and Description |
|---|---|
static class |
IdStrategy.Builder |
| Modifier and Type | Method and Description |
|---|---|
static IdStrategy.Builder |
build(java.lang.String idKey)
Create the
IdStrategy.Builder to create a IdStrategy. |
java.util.function.UnaryOperator<TriFunction<java.lang.String,Vertex,java.lang.Object[],Edge>> |
getAddEdgeStrategy(StrategyContext<StrategyVertex> ctx,
GraphStrategy composingStrategy)
Construct a
TriFunction that enhances the features of
Vertex.addEdge(String, com.tinkerpop.gremlin.structure.Vertex, Object...). |
java.util.function.UnaryOperator<java.util.function.Function<java.lang.Object[],Vertex>> |
getAddVertexStrategy(StrategyContext<StrategyGraph> ctx,
GraphStrategy composingStrategy)
Construct a
Function that enhances the features of Graph.addVertex(Object...). |
java.util.function.UnaryOperator<java.util.function.Supplier<java.lang.Object>> |
getEdgeIdStrategy(StrategyContext<StrategyEdge> ctx,
GraphStrategy composingStrategy)
Construct a
Supplier that enhances the features of Element.id(). |
<V> java.util.function.UnaryOperator<java.util.function.BiFunction<java.lang.String,V,Property<V>>> |
getEdgePropertyStrategy(StrategyContext<StrategyEdge> ctx,
GraphStrategy composingStrategy)
Construct a
BiFunction that enhances the features of Element.property(String, Object). |
java.util.function.UnaryOperator<java.util.function.Function<java.lang.Object[],GraphTraversal<Edge,Edge>>> |
getGraphEStrategy(StrategyContext<StrategyGraph> ctx,
GraphStrategy composingStrategy)
Construct a
Function that enhances the features of Graph.E(java.lang.Object...). |
java.util.function.UnaryOperator<java.util.function.Function<java.lang.Object[],java.util.Iterator<Edge>>> |
getGraphIteratorsEdgeIteratorStrategy(StrategyContext<StrategyGraph> ctx,
GraphStrategy composingStrategy)
Construct a
Function that enhances the features of Graph.Iterators.edgeIterator(java.lang.Object...). |
java.util.function.UnaryOperator<java.util.function.Function<java.lang.Object[],java.util.Iterator<Vertex>>> |
getGraphIteratorsVertexIteratorStrategy(StrategyContext<StrategyGraph> ctx,
GraphStrategy composingStrategy)
Construct a
Function that enhances the features of Graph.Iterators.vertexIterator(java.lang.Object...). |
java.util.function.UnaryOperator<java.util.function.Function<java.lang.Object[],GraphTraversal<Vertex,Vertex>>> |
getGraphVStrategy(StrategyContext<StrategyGraph> ctx,
GraphStrategy composingStrategy)
Construct a
Function that enhances the features of Graph.V(java.lang.Object...). |
java.lang.String |
getIdKey()
Gets the property name of the key used to lookup graph elements.
|
java.util.function.UnaryOperator<java.util.function.Supplier<java.lang.Object>> |
getVertexIdStrategy(StrategyContext<StrategyVertex> ctx,
GraphStrategy composingStrategy)
Construct a
Supplier that enhances the features of Element.id(). |
<V> java.util.function.UnaryOperator<java.util.function.BiFunction<java.lang.String,V,VertexProperty<V>>> |
getVertexPropertyStrategy(StrategyContext<StrategyVertex> ctx,
GraphStrategy composingStrategy)
Construct a
BiFunction that enhances the features of Vertex.property(String, Object). |
boolean |
isSupportsEdgeId() |
boolean |
isSupportsVertexId() |
java.lang.String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetEdgeGetPropertyStrategy, getEdgeGraphStrategy, getEdgeIteratorsPropertyIteratorStrategy, getEdgeIteratorsValueIteratorStrategy, getEdgeIteratorsVertexIteratorStrategy, getEdgeKeysStrategy, getEdgeLabelStrategy, getEdgeValueStrategy, getGraphCloseStrategy, getPropertyKeyStrategy, getPropertyValueStrategy, getRemoveEdgeStrategy, getRemovePropertyStrategy, getRemoveVertexPropertyStrategy, getRemoveVertexStrategy, getVariableAsMapStrategy, getVariableGetStrategy, getVariableKeysStrategy, getVariableRemoveStrategy, getVariableSetStrategy, getVertexGetPropertyStrategy, getVertexGraphStrategy, getVertexIteratorsEdgeIteratorStrategy, getVertexIteratorsPropertyIteratorStrategy, getVertexIteratorsValueIteratorStrategy, getVertexIteratorsVertexIteratorStrategy, getVertexKeysStrategy, getVertexLabelStrategy, getVertexPropertyGetElementStrategy, getVertexPropertyGraphStrategy, getVertexPropertyIdStrategy, getVertexPropertyIteratorsPropertyIteratorStrategy, getVertexPropertyIteratorsValueIteratorStrategy, getVertexPropertyKeysStrategy, getVertexPropertyKeyStrategy, getVertexPropertyLabelStrategy, getVertexPropertyPropertyStrategy, getVertexPropertyValueStrategy, getVertexValueStrategypublic java.util.function.UnaryOperator<java.util.function.Function<java.lang.Object[],Vertex>> getAddVertexStrategy(StrategyContext<StrategyGraph> ctx, GraphStrategy composingStrategy)
GraphStrategyFunction that enhances the features of Graph.addVertex(Object...).getAddVertexStrategy in interface GraphStrategyctx - the context within which this strategy function is calledcomposingStrategy - the strategy that composed this strategy functionFunction that accepts a Function with Graph.addVertex(Object...) signature
and returns an enhanced strategy Function with the same signaturepublic java.util.function.UnaryOperator<TriFunction<java.lang.String,Vertex,java.lang.Object[],Edge>> getAddEdgeStrategy(StrategyContext<StrategyVertex> ctx, GraphStrategy composingStrategy)
GraphStrategyTriFunction that enhances the features of
Vertex.addEdge(String, com.tinkerpop.gremlin.structure.Vertex, Object...).getAddEdgeStrategy in interface GraphStrategyctx - the context within which this strategy function is calledcomposingStrategy - the strategy that composed this strategy functionFunction that accepts a TriFunction with
Vertex.addEdge(String, com.tinkerpop.gremlin.structure.Vertex, Object...) signature
and returns an enhanced strategy Function with the same signaturepublic java.util.function.UnaryOperator<java.util.function.Function<java.lang.Object[],java.util.Iterator<Edge>>> getGraphIteratorsEdgeIteratorStrategy(StrategyContext<StrategyGraph> ctx, GraphStrategy composingStrategy)
GraphStrategyFunction that enhances the features of Graph.Iterators.edgeIterator(java.lang.Object...).getGraphIteratorsEdgeIteratorStrategy in interface GraphStrategyctx - the context within which this strategy function is calledcomposingStrategy - the strategy that composed this strategy functionFunction that accepts a Function with
Graph.Iterators.edgeIterator(java.lang.Object...) signature
and returns an enhanced strategy Supplier with the same signaturepublic java.util.function.UnaryOperator<java.util.function.Function<java.lang.Object[],java.util.Iterator<Vertex>>> getGraphIteratorsVertexIteratorStrategy(StrategyContext<StrategyGraph> ctx, GraphStrategy composingStrategy)
GraphStrategyFunction that enhances the features of Graph.Iterators.vertexIterator(java.lang.Object...).getGraphIteratorsVertexIteratorStrategy in interface GraphStrategyctx - the context within which this strategy function is calledcomposingStrategy - the strategy that composed this strategy functionFunction that accepts a Function with
Graph.Iterators.vertexIterator(java.lang.Object...) signature
and returns an enhanced strategy Supplier with the same signaturepublic java.util.function.UnaryOperator<java.util.function.Function<java.lang.Object[],GraphTraversal<Edge,Edge>>> getGraphEStrategy(StrategyContext<StrategyGraph> ctx, GraphStrategy composingStrategy)
GraphStrategyFunction that enhances the features of Graph.E(java.lang.Object...).getGraphEStrategy in interface GraphStrategyctx - the context within which this strategy function is calledcomposingStrategy - the strategy that composed this strategy functionFunction that accepts a Function with
Graph.E(java.lang.Object...) signature
and returns an enhanced strategy Function with the same signaturepublic java.util.function.UnaryOperator<java.util.function.Function<java.lang.Object[],GraphTraversal<Vertex,Vertex>>> getGraphVStrategy(StrategyContext<StrategyGraph> ctx, GraphStrategy composingStrategy)
GraphStrategyFunction that enhances the features of Graph.V(java.lang.Object...).getGraphVStrategy in interface GraphStrategyctx - the context within which this strategy function is calledcomposingStrategy - the strategy that composed this strategy functionFunction that accepts a Function with
Graph.V(java.lang.Object...) signature
and returns an enhanced strategy Function with the same signaturepublic java.util.function.UnaryOperator<java.util.function.Supplier<java.lang.Object>> getVertexIdStrategy(StrategyContext<StrategyVertex> ctx, GraphStrategy composingStrategy)
GraphStrategySupplier that enhances the features of Element.id().getVertexIdStrategy in interface GraphStrategyctx - the context within which this strategy function is calledcomposingStrategy - the strategy that composed this strategy functionFunction that accepts a Supplier with
Element.id() signature
and returns an enhanced strategy Supplier with the same signaturepublic java.util.function.UnaryOperator<java.util.function.Supplier<java.lang.Object>> getEdgeIdStrategy(StrategyContext<StrategyEdge> ctx, GraphStrategy composingStrategy)
GraphStrategySupplier that enhances the features of Element.id().getEdgeIdStrategy in interface GraphStrategyctx - the context within which this strategy function is calledcomposingStrategy - the strategy that composed this strategy functionFunction that accepts a Supplier with
Element.id() signature
and returns an enhanced strategy Supplier with the same signaturepublic <V> java.util.function.UnaryOperator<java.util.function.BiFunction<java.lang.String,V,VertexProperty<V>>> getVertexPropertyStrategy(StrategyContext<StrategyVertex> ctx, GraphStrategy composingStrategy)
GraphStrategyBiFunction that enhances the features of Vertex.property(String, Object).getVertexPropertyStrategy in interface GraphStrategyctx - the context within which this strategy function is calledcomposingStrategy - the strategy that composed this strategy functionFunction that accepts a BiFunction with
Vertex.property(String, Object) signature
and returns an enhanced strategy BiFunction with the same signaturepublic <V> java.util.function.UnaryOperator<java.util.function.BiFunction<java.lang.String,V,Property<V>>> getEdgePropertyStrategy(StrategyContext<StrategyEdge> ctx, GraphStrategy composingStrategy)
GraphStrategyBiFunction that enhances the features of Element.property(String, Object).getEdgePropertyStrategy in interface GraphStrategyctx - the context within which this strategy function is calledcomposingStrategy - the strategy that composed this strategy functionFunction that accepts a BiFunction with
Element.property(String, Object) signature
and returns an enhanced strategy BiFunction with the same signaturepublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String getIdKey()
public boolean isSupportsVertexId()
public boolean isSupportsEdgeId()
public static IdStrategy.Builder build(java.lang.String idKey)
IdStrategy.Builder to create a IdStrategy.idKey - The key to use for the index to lookup graph elements.Copyright © 2013-2015 TinkerPop. All Rights Reserved.