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 2021/04/02 10:43:44 UTC
[tinkerpop] branch master updated: add a public helper method to
retrieve select key from WherePredicateStep
This is an automated email from the ASF dual-hosted git repository.
spmallette pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git
The following commit(s) were added to refs/heads/master by this push:
new bd3df57 add a public helper method to retrieve select key from WherePredicateStep
new b6d98a0 Merge branch '3.4-dev'
bd3df57 is described below
commit bd3df5771b27eea6982abff3bc152e95e7d71bef
Author: Norio Akagi <no...@amazon.com>
AuthorDate: Thu Feb 18 14:26:13 2021 -0800
add a public helper method to retrieve select key from WherePredicateStep
---
.../gremlin/process/traversal/step/filter/WherePredicateStep.java | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/WherePredicateStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/WherePredicateStep.java
index 240a4cc..72dfebf 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/WherePredicateStep.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/WherePredicateStep.java
@@ -69,7 +69,7 @@ public final class WherePredicateStep<S> extends FilterStep<S> implements Scopin
if (predicate instanceof ConnectiveP)
((ConnectiveP<Object>) predicate).getPredicates().forEach(this::configurePredicates);
else {
- final String selectKey = (String) (predicate.getValue() instanceof Collection ? ((Collection) predicate.getValue()).iterator().next() : predicate.getValue()); // hack for within("x"))
+ final String selectKey = getSelectKey(predicate);
this.selectKeys.add(selectKey);
this.scopeKeys.add(selectKey);
}
@@ -90,6 +90,11 @@ public final class WherePredicateStep<S> extends FilterStep<S> implements Scopin
return Optional.ofNullable(this.startKey);
}
+ public String getSelectKey(final P<Object> predicate) {
+ return (String) (predicate.getValue() instanceof Collection ? ((Collection) predicate.getValue()).iterator().next()
+ : predicate.getValue()); // hack for within("x"))
+ }
+
public void removeStartKey() {
this.selectKeys.remove(this.startKey);
this.startKey = null;