Cole-Greer commented on code in PR #3483:
URL: https://github.com/apache/tinkerpop/pull/3483#discussion_r3540319085
##########
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java:
##########
@@ -3463,6 +3505,72 @@ public default GraphTraversal<S, E> drop() {
return this.asAdmin().addStep(new DropStep<>(this.asAdmin()));
}
+ /**
+ * Adds one or more labels to the current element. This is a side-effect
step that passes the
+ * element through unchanged.
+ *
+ * @param label the first label to add
+ * @param moreLabels additional labels to add
+ * @return the traversal with an appended {@link AddLabelStep}
+ * @since 4.0.0
+ */
+ public default GraphTraversal<S, E> addLabel(final String label, final
String... moreLabels) {
+ this.asAdmin().getGremlinLang().addStep(Symbols.addLabel, label,
moreLabels);
+ return this.asAdmin().addStep((AddLabelStep) new
AddLabelStep<>(this.asAdmin(), label, moreLabels));
+ }
+
+ /**
+ * Adds dynamically computed labels to the current element. This is a
side-effect step that passes the
+ * element through unchanged.
+ *
+ * @param labelTraversal the traversal that produces labels to add
Review Comment:
This has been updated to follow the standard traversal varargs pattern. All
traversals get iterated once, if there is exactly one traversal provided and it
produces a `Collection`, that collection gets automatically spread into the
label set.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]