Interface SimpleFunction


public interface SimpleFunction
A custom simple language function This allows to plugin custom functions to the built-in simple language.
Since:
4.18
  • Method Summary

    Modifier and Type
    Method
    Description
    default boolean
    Whether this custom function allows null as input value.
    @Nullable Object
    apply(Exchange exchange, @Nullable Object input)
    Applies the function to the given input
    The name of the function.
  • Method Details

    • getName

      String getName()
      The name of the function. Notice the name must not clash with any of the built-in function names.
    • apply

      @Nullable Object apply(Exchange exchange, @Nullable Object input) throws Exception
      Applies the function to the given input
      Parameters:
      exchange - the current exchange
      input - the input object, can be null
      Returns:
      the response
      Throws:
      Exception - can be thrown if there was an error
    • allowNull

      default boolean allowNull()
      Whether this custom function allows null as input value. This is default false to avoid NullPointerException and how the built-in functions also behaves.