Class DynamicFunction

All Implemented Interfaces:
Serializable, IBoxRunnable, IFunctionRunnable, IType

public class DynamicFunction extends UDF
This represents a BoxLang Function that will be created dynamically either by Java or BoxLang. It can be used to generate using a Java Lambda, or subclass with no compiling or parsing. The impetus of this class is to be able to have an injected mixin that can pivot according to the name of the function as it's injected into a BoxLang class.
See Also:
  • Constructor Details

    • DynamicFunction

      public DynamicFunction(Key name, BiFunction<FunctionBoxContext,DynamicFunction,Object> target, Argument[] arguments, String returnType, String hint, IStruct annotations)
      Full Constructor
      Parameters:
      name - The name of the function that will be used to register it
      arguments - The arguments of the function
      returnType - The return type of the function
      hint - The hint of the function
      annotations - The annotations of the function
    • DynamicFunction

      public DynamicFunction(Key name, BiFunction<FunctionBoxContext,DynamicFunction,Object> target, Argument[] arguments)
      Simple Constructor of just the name and the target and arguments
      Parameters:
      name - The name of the function that will be used to register it
      target - The target lambda that will be executed when the function is called
      arguments - The arguments of the function
    • DynamicFunction

      public DynamicFunction(Key name, BiFunction<FunctionBoxContext,DynamicFunction,Object> target)
      Simple Constructor of just the name and the target
      Parameters:
      name - The name of the function that will be used to register it
      target - The target lambda that will be executed when the function is called
    • DynamicFunction

      public DynamicFunction(Key name, BiFunction<FunctionBoxContext,DynamicFunction,Object> target, String returnType)
      Simple Constructor of just the name, target, and return type
      Parameters:
      name - The name of the function that will be used to register it
      target - The target lambda that will be executed when the function is called
      returnType - The return type of the function
  • Method Details