diff --git a/graph-projection-api/src/main/java/org/neo4j/gds/api/nodeproperties/ValueType.java b/graph-projection-api/src/main/java/org/neo4j/gds/api/nodeproperties/ValueType.java index 8eb5b0a6a10..2b161bb1482 100644 --- a/graph-projection-api/src/main/java/org/neo4j/gds/api/nodeproperties/ValueType.java +++ b/graph-projection-api/src/main/java/org/neo4j/gds/api/nodeproperties/ValueType.java @@ -21,6 +21,11 @@ import org.jetbrains.annotations.Nullable; import org.neo4j.gds.api.DefaultValue; +import org.neo4j.gds.utils.StringJoining; + +import java.util.Arrays; + +import static org.neo4j.gds.utils.StringFormatting.formatWithLocale; public enum ValueType { LONG { @@ -188,17 +193,31 @@ public static ValueType fromCsvName(String csvName) { return value; } } - throw new IllegalArgumentException("Unexpected value: " + csvName); + + throw new IllegalArgumentException( + formatWithLocale( + "Unknown value: %s, supported values are: %s", + csvName, + StringJoining.join(Arrays.stream(ValueType.values()).map(ValueType::csvName)) + ) + ); } public interface Visitor { RESULT visitLong(); + RESULT visitDouble(); + RESULT visitString(); + RESULT visitLongArray(); + RESULT visitDoubleArray(); + RESULT visitFloatArray(); - default @Nullable RESULT visitUnknown() { return null; } + default @Nullable RESULT visitUnknown() { + return null; + } } }