graphql.nadel.engine.result.ResultNodeTraverser Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of nadel-engine Show documentation
Show all versions of nadel-engine Show documentation
Nadel is a Java library that combines multiple GrahpQL services together into one API.
The newest version!
package graphql.nadel.engine.result;
import graphql.Internal;
import graphql.util.Traverser;
import graphql.util.TraverserVisitor;
import java.util.Collection;
@Internal
public class ResultNodeTraverser {
private final Traverser traverser;
private ResultNodeTraverser(Traverser traverser) {
this.traverser = traverser;
}
public static ResultNodeTraverser depthFirst() {
return new ResultNodeTraverser(Traverser.depthFirst(ExecutionResultNode::getChildren, null, null));
}
public void traverse(TraverserVisitor visitor, ExecutionResultNode root) {
traverser.traverse(root, visitor);
}
public void traverse(TraverserVisitor visitor, Collection extends ExecutionResultNode> roots) {
traverser.traverse(roots, visitor);
}
}