public Legal checkEdgeLegality(final Direction direction) {
        if (null == this.edgeFilter)
            return Legal.YES;
        else if (this.allowNoEdges)
            return Legal.NO;
        return this.edgeLegality.get(direction).values()
                .stream()
                .reduce(Legal.NO, (a, b) -> a.compareTo(b) < 0 ? a : b);
    }
Get the legality of a particular edge direction.

@param direction the direction of the edge.
@return the {@link Legal} of the edge direction.
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphFilter.java