Class FunctionInvoker


  • public class FunctionInvoker
    extends Object
    The FunctionInvoker is a wrapper on a java method which supports arguments type conversion and method invocation via reflection.
    • Constructor Detail

      • FunctionInvoker

        public FunctionInvoker​(FunctionInfo functionInfo)
    • Method Detail

      • getMethod

        public Method getMethod()
        Returns the underlying java method.
      • getParameterClasses

        public Class<?>[] getParameterClasses()
        Returns the class of the parameters.
      • getParameterTypes

        public PinotDataType[] getParameterTypes()
        Returns the PinotDataType of the parameters for type conversion purpose. Puts null for the parameter class that does not support type conversion.
      • convertTypes

        public void convertTypes​(Object[] arguments)
        Converts the type of the given arguments to match the parameter classes. Leaves the argument as is if type conversion is not needed or supported.
      • getResultClass

        public Class<?> getResultClass()
        Returns the class of the result value.
      • invoke

        public Object invoke​(Object[] arguments)
        Invoke the function with the given arguments. The arguments should match the parameter classes. Use convertTypes(Object[]) to convert the argument types if needed before calling this method.