Repository: tinkerpop Updated Branches: refs/heads/TINKERPOP-1975 [created] 5b20beda6
wip Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/24c49901 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/24c49901 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/24c49901 Branch: refs/heads/TINKERPOP-1975 Commit: 24c4990131f6a834e0f8b1b4a86b77c78251cb4b Parents: 4f46095 Author: Stephen Mallette <[email protected]> Authored: Wed May 23 08:46:34 2018 -0400 Committer: Stephen Mallette <[email protected]> Committed: Wed May 23 08:46:34 2018 -0400 ---------------------------------------------------------------------- .../traversal/dsl/graph/GraphTraversal.java | 19 ++++++++++++++ .../process/traversal/step/WithModulating.java | 26 ++++++++++++++++++++ .../process/traversal/step/WithModulation.java | 26 ++++++++++++++++++++ 3 files changed, 71 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/24c49901/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java ---------------------------------------------------------------------- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java index 0fd3599..b7bf736 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java @@ -40,6 +40,8 @@ import org.apache.tinkerpop.gremlin.process.traversal.step.FromToModulating; import org.apache.tinkerpop.gremlin.process.traversal.step.Mutating; import org.apache.tinkerpop.gremlin.process.traversal.step.TimesModulating; import org.apache.tinkerpop.gremlin.process.traversal.step.TraversalOptionParent; +import org.apache.tinkerpop.gremlin.process.traversal.step.WithModulating; +import org.apache.tinkerpop.gremlin.process.traversal.step.WithModulation; import org.apache.tinkerpop.gremlin.process.traversal.step.branch.BranchStep; import org.apache.tinkerpop.gremlin.process.traversal.step.branch.ChooseStep; import org.apache.tinkerpop.gremlin.process.traversal.step.branch.LocalStep; @@ -2496,6 +2498,22 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> { return this.asAdmin().addStep(new LambdaCollectingBarrierStep<>(this.asAdmin(), (Consumer) barrierConsumer, Integer.MAX_VALUE)); } + //// WITH-MODULATORS + + /** + * Provides a configuration to a step in the form of a {@link WithModulation}. The step configuration must be + * step specific and therefore a configuration could be supplied that is not known to be valid until execution. + * + * @param config the configuration to apply to a step + * @return the traversal with a modulated step + * @see <a href="http://tinkerpop.apache.org/docs/${project.version}/reference/#with-step" target="_blank">Reference Documentation - With Step</a> + * @since 3.4.0 + */ + public default GraphTraversal<S,E> with(final WithModulation config) { + this.asAdmin().getBytecode().addStep(Symbols.with, config); + ((WithModulating) this.asAdmin().getEndStep()).modulateWith(config); + return this; + } //// BY-MODULATORS @@ -2804,6 +2822,7 @@ public interface GraphTraversal<S, E> extends Traversal<S, E> { public static final String times = "times"; public static final String as = "as"; public static final String option = "option"; + public static final String with = "with"; } } http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/24c49901/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/WithModulating.java ---------------------------------------------------------------------- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/WithModulating.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/WithModulating.java new file mode 100644 index 0000000..2a81c45 --- /dev/null +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/WithModulating.java @@ -0,0 +1,26 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.tinkerpop.gremlin.process.traversal.step; + +/** + * @author Stephen Mallette (http://stephen.genoprime.com) + */ +public interface WithModulating { + public void modulateWith(final WithModulation configuration); +} http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/24c49901/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/WithModulation.java ---------------------------------------------------------------------- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/WithModulation.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/WithModulation.java new file mode 100644 index 0000000..404b02f --- /dev/null +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/WithModulation.java @@ -0,0 +1,26 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.tinkerpop.gremlin.process.traversal.step; + +/** + * @author Stephen Mallette (http://stephen.genoprime.com) + */ +public interface WithModulation { + public Object[] +}
