callNonvirtualMethod

context(env: JniEnv)
inline fun <R> JObject.callNonvirtualMethod(clazz: JClass, methodId: JMethodID, args: JArguments): R(source)

Unifies usage of callNonvirtual<type>Method methods, returning method with the appropriate type wrapped in lambda.

If type R is primitive type, it cannot be nullable, otherwise it must be nullable.