You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by sp...@apache.org on 2015/05/04 17:32:14 UTC

[3/3] incubator-tinkerpop git commit: Update javadoc on ElementIdStrategy.

Update javadoc on ElementIdStrategy.


Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/f0cddfa7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/f0cddfa7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/f0cddfa7

Branch: refs/heads/master
Commit: f0cddfa7b0606fff9de47b6ce0dfa5e15072327c
Parents: 4686df7
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon May 4 11:31:57 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon May 4 11:31:57 2015 -0400

----------------------------------------------------------------------
 .../strategy/decoration/ElementIdStrategy.java    | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/f0cddfa7/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/ElementIdStrategy.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/ElementIdStrategy.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/ElementIdStrategy.java
index 9128b46..f7b0d5e 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/ElementIdStrategy.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/ElementIdStrategy.java
@@ -43,7 +43,18 @@ import java.util.UUID;
 import java.util.function.Supplier;
 
 /**
+ * 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.
+ * <p/>
+ * By default, when an identifier is not supplied by the user, newly generated identifiers are {@link UUID} objects.
+ * This behavior can be overriden by setting the {@link Builder#idMaker(Supplier)}.
+ * <p/>
+ * Unless otherwise specified the identifier is stored in the {@code __id} property.  This can be changed by setting
+ * the {@link Builder#idPropertyKey(String}
+ *
  * @author Marko A. Rodriguez (http://markorodriguez.com)
+ * @author Stephen Mallette (http://stephen.genoprime.com)
  */
 public final class ElementIdStrategy extends AbstractTraversalStrategy {
 
@@ -147,11 +158,18 @@ public final class ElementIdStrategy extends AbstractTraversalStrategy {
 
         private Builder() {}
 
+        /**
+         * Creates a new unique identifier for the next created {@link Element}.
+         */
         public Builder idMaker(final Supplier<Object> idMaker) {
             this.idMaker = idMaker;
             return this;
         }
 
+        /**
+         * This key within which to hold the user-specified identifier.  This field should be indexed by the
+         * underlying graph.
+         */
         public Builder idPropertyKey(final String idPropertyKey) {
             this.idPropertyKey = idPropertyKey;
             return this;