|
20 | 20 | package org.neo4j.gds.procedures.algorithms.centrality; |
21 | 21 |
|
22 | 22 | import org.neo4j.gds.applications.algorithms.machinery.AlgorithmProcessingTimings; |
23 | | -import org.neo4j.gds.result.AbstractResultBuilder; |
24 | 23 |
|
25 | 24 | import java.util.Map; |
26 | 25 |
|
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 | +) { |
44 | 32 |
|
45 | 33 | static CELFStatsResult emptyFrom(AlgorithmProcessingTimings timings, Map<String, Object> configurationMap) { |
46 | 34 | return new CELFStatsResult(timings.computeMillis, 0, 0, configurationMap); |
47 | 35 | } |
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 | | - } |
61 | 36 | } |
0 commit comments