User defined procedures and functions are written as Java classes
Example user defined function to join list of strings with a separator
example.join(['Hello', 'NODES'], ',')
Compile and package project with Maven to produce plugin JAR file
mvn clean package → target/example-1.0.0.jar
public class Join {
@UserFunction
@Description("example.join(['a','b'], ','))
public String join(
@Name("strings") List<String> strings,
@Name("delimiter") String delimiter) {
if (strings == null || delimiter == null)
return null;
return String.join(delimiter, strings);
}
}