Reflect Utils
class ReflectUtils
Utility class to ease Reflection
Functions
Link copied to clipboard
Link copied to clipboard
Gets the constructor for class T matching the specified arguments
Link copied to clipboard
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
Link copied to clipboard
Link copied to clipboard
open fun invokeMethod(@NonNull clazz: Class<out Any>, @Nullable instance: Any, @NonNull methodName: String, args: Array<Any>): Any
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