Reflect Util
object ReflectUtil
Lightweight utility for fast reflective access using VarHandle, MethodHandle and LambdaMetafactory.
Usage examples:
// VarHandle read/write VarHandle vh = ReflectUtil.findVarHandle(MyClass.class, "value", int.class); int v = (int) ReflectUtil.vhGet(vh, myObj); ReflectUtil.vhSet(vh, myObj, 123); // Method handle invoke MethodHandle mh = ReflectUtil.findMethodHandle(MyClass.class, "compute", int.class); Object result = ReflectUtil.invoke(mh, myObj, 5);*
Functions
Link copied to clipboard
Find and cache the first varhandle in a class with a specified field type.
Link copied to clipboard
Try to get a class from possible names.
Link copied to clipboard
fun invokeWithParamType(caller: Any, name: String, paramTypes: MutableList<Class<*>>, vararg args: Any?): Result<*>
Link copied to clipboard
Link copied to clipboard