Skip to content

Commit 174b080

Browse files
committed
build out a translator-renderer pair so that we can decouple, isolate and test bits of path output marshalling
1 parent 28c2884 commit 174b080

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

applications/algorithms/path-finding/src/main/java/org/neo4j/gds/applications/algorithms/pathfinding/PathUsingInternalNodeIds.java

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,28 @@
1919
*/
2020
package org.neo4j.gds.applications.algorithms.pathfinding;
2121

22+
import org.apache.commons.lang3.builder.EqualsBuilder;
23+
import org.apache.commons.lang3.builder.HashCodeBuilder;
24+
2225
/**
2326
* Back in the day, this would be a DTO I guess
2427
*/
25-
public record PathUsingInternalNodeIds(long sourceNode, long targetNode, long[] nodeIds, double[] costs, double totalCost) {}
28+
public record PathUsingInternalNodeIds(
29+
long sourceNode,
30+
long targetNode,
31+
long[] nodeIds,
32+
double[] costs,
33+
double totalCost) {
34+
/**
35+
* Arrays are the bane of pretty code
36+
*/
37+
@Override
38+
public boolean equals(Object obj) {
39+
return EqualsBuilder.reflectionEquals(this, obj);
40+
}
41+
42+
@Override
43+
public int hashCode() {
44+
return HashCodeBuilder.reflectionHashCode(this);
45+
}
46+
}

0 commit comments

Comments
 (0)