Class VarArgsToMapAdapterGenerator


  • public final class VarArgsToMapAdapterGenerator
    extends Object
    • Method Detail

      • generateVarArgsToMapAdapter

        public static MethodHandle generateVarArgsToMapAdapter​(Class<?> returnType,
                                                               List<Class<?>> javaTypes,
                                                               List<String> names,
                                                               Function<Map<String,​Object>,​Object> function)
        Generate byte code that

        • takes a specified number of variables as arguments (types of the arguments are provided in javaTypes)
        • put the variables in a map (keys of the map are provided in names)
        • invoke the provided function with the map
        • return with the result of the function call (type must match returnType)