All Downloads are FREE. Search and download functionalities are using the official Maven repository.

dev.vality.woody.api.proxy.MethodCallerFactory Maven / Gradle / Ivy

There is a newer version: 2.0.8
Show newest version
package dev.vality.woody.api.proxy;

import java.lang.reflect.Method;
import java.util.function.BiFunction;

public interface MethodCallerFactory {
    InstanceMethodCaller getInstance(InvocationTargetProvider targetProvider, Method method);

    default InstanceMethodCaller getInstance(InvocationTargetProvider targetProvider, Method method,
                                             BiFunction function) {
        return new InstanceMethodCaller(method) {
            @Override
            public Object call(Object source, Object[] args) throws Throwable {
                return function.apply(source, args);
            }
        };
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy