getMethodByArgs

open fun getMethodByArgs(@NonNull clazz: Class<out Any>, @NonNull methodName: String, args: Array<Any>): Method

Attempts to find and invoke the method matching the specified arguments Please note that this does not cache the lookup result, so if you need to call this many times you should do it manually and cache the Method to improve performance drastically

Return

The found method

Parameters

clazz

The class

methodName

The name of the method

args

The arguments to invoke the method with. arguments [ "hello", 12 ] would match someMethod(String s, int i)

Throws

No such constructor found