Skip to content

Commit 179d8f9

Browse files
committed
Convert CELFStatsResult to record
1 parent 612ff86 commit 179d8f9

File tree

1 file changed

+6
-31
lines changed
  • procedures/facade-api/centrality-facade-api/src/main/java/org/neo4j/gds/procedures/algorithms/centrality

1 file changed

+6
-31
lines changed

procedures/facade-api/centrality-facade-api/src/main/java/org/neo4j/gds/procedures/algorithms/centrality/CELFStatsResult.java

Lines changed: 6 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -20,42 +20,17 @@
2020
package org.neo4j.gds.procedures.algorithms.centrality;
2121

2222
import org.neo4j.gds.applications.algorithms.machinery.AlgorithmProcessingTimings;
23-
import org.neo4j.gds.result.AbstractResultBuilder;
2423

2524
import java.util.Map;
2625

27-
public final class CELFStatsResult {
28-
public final long computeMillis;
29-
public final double totalSpread;
30-
public final long nodeCount;
31-
public final Map<String, Object> configuration;
32-
33-
34-
public CELFStatsResult(long computeMillis, double totalSpread, long nodeCount, Map<String, Object> configuration) {
35-
this.computeMillis = computeMillis;
36-
this.totalSpread = totalSpread;
37-
this.nodeCount = nodeCount;
38-
this.configuration = configuration;
39-
}
40-
41-
public static Builder builder() {
42-
return new Builder();
43-
}
26+
public record CELFStatsResult(
27+
long computeMillis,
28+
double totalSpread,
29+
long nodeCount,
30+
Map<String, Object> configuration
31+
) {
4432

4533
static CELFStatsResult emptyFrom(AlgorithmProcessingTimings timings, Map<String, Object> configurationMap) {
4634
return new CELFStatsResult(timings.computeMillis, 0, 0, configurationMap);
4735
}
48-
49-
public static class Builder extends AbstractResultBuilder<CELFStatsResult> {
50-
private double totalSpread;
51-
52-
public Builder withTotalSpread(double totalSpread) {
53-
this.totalSpread = totalSpread;
54-
return this;
55-
}
56-
57-
public CELFStatsResult build() {
58-
return new CELFStatsResult(computeMillis, totalSpread, nodeCount, config.toMap());
59-
}
60-
}
6136
}

0 commit comments

Comments
 (0)