package com.tinkerpop.blueprints.strategy;

import com.tinkerpop.blueprints.Vertex;
import org.javatuples.Triplet;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.function.UnaryOperator;

/**
 * @author Stephen Mallette (http://stephen.genoprime.com)
 */
public class SequenceGraphStrategy implements GraphStrategy {
    private final List<GraphStrategy> graphStrategySequence;

    public SequenceGraphStrategy(final GraphStrategy... strategies) {
        this.graphStrategySequence = new ArrayList<>(Arrays.asList(strategies));
    }

    @Override
    public UnaryOperator<Object[]> getPreAddVertex() {
        return this.graphStrategySequence.stream().map(s -> s.getPreAddVertex()).reduce(null,
                (acc, next) -> acc == null ? next : (UnaryOperator<Object[]>) acc.andThen(next));
    }

    @Override
    public UnaryOperator<Vertex> getPostAddVertex() {
        return this.graphStrategySequence.stream().map(s -> s.getPostAddVertex()).reduce(null,
                (acc, next) -> acc == null ? next : (UnaryOperator<Vertex>) acc.andThen(next));
    }

    @Override
    public UnaryOperator<Triplet<String, Vertex, Object[]>> getPreAddEdge() {
        return this.graphStrategySequence.stream().map(s -> s.getPreAddEdge()).reduce(null,
                (acc, next) -> acc == null ? next : (UnaryOperator<Triplet<String, Vertex, Object[]>>) acc.andThen(next));
    }
}
@@ -37,16 +37,54 @@
 ategy;%0A%0A
+import com.tinkerpop.blueprints.Edge;%0A
 import c
@@ -1460,10 +1460,268 @@
 );%0A    %7D
+%0A%0A    @Override%0A    public UnaryOperator%3CEdge%3E getPostAddEdge() %7B%0A        return this.graphStrategySequence.stream().map(s -%3E s.getPostAddEdge()).reduce(null,%0A                (acc, next) -%3E acc == null ? next : (UnaryOperator%3CEdge%3E) acc.andThen(next));%0A    %7D
 %0A%7D

Add getPostAddEdge to SequenceGraphStrategy.