use of org.neo4j.helpers.collection.IterableWrapper in project neo4j by neo4j.
the class DatabaseActions method findPaths.
@SuppressWarnings({ "rawtypes", "unchecked" })
public ListRepresentation findPaths(long startId, long endId, Map<String, Object> map) {
final FindParams findParams = new FindParams(startId, endId, map).invoke();
PathFinder finder = findParams.getFinder();
Node startNode = findParams.getStartNode();
Node endNode = findParams.getEndNode();
Iterable paths = finder.findAllPaths(startNode, endNode);
IterableWrapper<PathRepresentation, Path> pathRepresentations = new IterableWrapper<PathRepresentation, Path>(paths) {
@Override
protected PathRepresentation underlyingObjectToObject(Path path) {
return findParams.pathRepresentationOf(path);
}
};
return new ListRepresentation(RepresentationType.PATH, pathRepresentations);
}
Aggregations