Interface CustomFunctionBuilder
- All Known Implementing Classes:
CustomFunctionBuilderImpl
public interface CustomFunctionBuilder
Fluent builder to create a
CustomFunction.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Returns the custom function to be registered inFeelCustomFunctionProvider.Enable variable argumentssetFunction(Function<List<Object>, Object> function) Define the parameters of the custom function.setReturnValue(Object result) Define a custom function that only returns a value and has no further business logic (method body).
-
Method Details
-
setParams
Define the parameters of the custom function.- Parameters:
params- of the custom function- Returns:
- the builder
-
enableVarargs
CustomFunctionBuilder enableVarargs()Enable variable arguments- Returns:
- the builder
-
setReturnValue
Define a custom function that only returns a value and has no further business logic (method body). It is not possible to use this method together withsetFunction(java.util.function.Function<java.util.List<java.lang.Object>, java.lang.Object>).- Parameters:
result- that should be returned by the custom function- Returns:
- the builder
-
setFunction
Pass aFunctionwith aListof objects as argument and an object as return value. It is not possible to use this method together withsetReturnValue(java.lang.Object).- Parameters:
function- to be called- Returns:
- the builder
-
build
CustomFunction build()Returns the custom function to be registered inFeelCustomFunctionProvider.- Returns:
- a custom function
- Throws:
FeelException- when bothsetFunction(java.util.function.Function<java.util.List<java.lang.Object>, java.lang.Object>)andsetReturnValue(java.lang.Object)were called
-