Skip to content

Commit

Permalink
[wokdlhX3] Move Virtual path builder back to core
Browse files Browse the repository at this point in the history
  • Loading branch information
Lojjs committed Jan 11, 2023
1 parent 96a0eeb commit dbfc55c
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions common/src/main/java/apoc/result/VirtualPath.java
Original file line number Diff line number Diff line change
Expand Up @@ -139,4 +139,23 @@ private void requireConnected(Relationship relationship) {
throw new IllegalArgumentException("Relationship is not part of current path.");
}
}

public static final class Builder {
private final Node start;
private final List<Relationship> relationships = new ArrayList<>();

public Builder(Node start) {
this.start = start;
}

public Builder push(Relationship relationship) {
this.relationships.add(relationship);
return this;
}

public VirtualPath build() {
return new VirtualPath(start, relationships);
}

}
}

0 comments on commit dbfc55c

Please sign in to comment.