13 lines
371 B
Kotlin
13 lines
371 B
Kotlin
|
package it.unisannio.ding.ids.wedroid.app
|
||
|
|
||
|
import kotlin.reflect.KClass
|
||
|
import kotlin.reflect.KFunction
|
||
|
import kotlin.reflect.full.declaredFunctions
|
||
|
import kotlin.reflect.jvm.isAccessible
|
||
|
|
||
|
fun getPrivateFun(name: String, kClass: KClass<*>): KFunction<*>? {
|
||
|
return kClass.declaredFunctions
|
||
|
.find { it.name == name }
|
||
|
.also { it?.isAccessible = true }
|
||
|
}
|