{% setvar book_path %}/reference/kotlin/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}
class ReflectiveMethod<T>
Helper class for making more performant reflection method invocations.
Lazy initializes and caches Method object to attempt to reduce reflection overhead.
Public constructors |
|
|---|---|
|
Creates a ReflectiveMethod. |
|
Public functions |
|
|---|---|
T |
Invoke the instance method. |
T |
invokeStatic(paramValues: Array<Any>)Invoke th static method. |
ReflectiveMethod(
className: String,
methodName: String,
paramTypes: Array<Class<Any>>
)
Creates a ReflectiveMethod.
fun invoke(object: Any, paramValues: Array<Any>): T
Invoke the instance method.
See invoke
| Parameters | |
|---|---|
object: Any |
the object the underlying method is invoked from |
paramValues: Array<Any> |
the arguments used for the method call |
| Returns | |
|---|---|
T |
the return value of the method |
| Throws | |
|---|---|
androidx.test.platform.reflect.ReflectionException |
if call could not be completed |