Search in sources :

Example 1 with InternalPath

use of org.neo4j.driver.internal.InternalPath in project cypher-for-gremlin by opencypher.

the class GremlinCypherValueConverter method toCypherPath.

@SuppressWarnings("unchecked")
private static Value toCypherPath(List p) {
    boolean isNode = true;
    Entity[] objects = new Entity[p.size()];
    for (int i = 0; i < p.size(); i++) {
        if (isNode) {
            objects[i] = toCypherNode((Map<?, ?>) p.get(i));
        } else {
            objects[i] = toCypherRelationship((Map<?, ?>) p.get(i));
        }
        isNode = !isNode;
    }
    return new InternalPath(objects).asValue();
}
Also used : Entity(org.neo4j.driver.v1.types.Entity) InternalPath(org.neo4j.driver.internal.InternalPath) HashMap(java.util.HashMap) Map(java.util.Map)

Aggregations

HashMap (java.util.HashMap)1 Map (java.util.Map)1 InternalPath (org.neo4j.driver.internal.InternalPath)1 Entity (org.neo4j.driver.v1.types.Entity)1