Skip to content

Commit 555a057

Browse files
authored
Betweenness Centrality result configuration (#11162)
1 parent 9771295 commit 555a057

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

procedures/facade-api/configs/centrality-configs/src/main/java/org/neo4j/gds/betweenness/BetweennessCentralityBaseConfig.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,10 @@
3737

3838
public interface BetweennessCentralityBaseConfig extends AlgoBaseConfig, RelationshipWeightConfig {
3939

40+
@Configuration.ConvertWith(method = "toLong")
4041
Optional<Long> samplingSize();
4142

43+
@Configuration.ConvertWith(method = "toLong")
4244
Optional<Long> samplingSeed();
4345

4446
@Configuration.Check
@@ -100,4 +102,14 @@ default BetweennessCentralityParameters toParameters() {
100102
hasRelationshipWeightProperty()
101103
);
102104
}
105+
106+
static Long toLong(Object obj) {
107+
if (obj instanceof Integer) {
108+
return ((Integer) obj).longValue();
109+
} else if (obj instanceof Long) {
110+
return (Long) obj;
111+
} else {
112+
throw new IllegalArgumentException("Object must be of type int, Integer, long, or Long");
113+
}
114+
}
103115
}

0 commit comments

Comments
 (0)