public final class KotlinReflectionUtils extends Object
KotlinDetector.isKotlinReflectPresent()
Modifier and Type | Method and Description |
---|---|
static kotlin.reflect.KFunction<?> |
findKotlinFunction(Method method)
Returns a
KFunction instance corresponding to the given Java Method instance, or null if
this method cannot be represented by a Kotlin function. |
static Class<?> |
getReturnType(Method method)
Returns the
return type of a Kotlin Method . |
static boolean |
isDataClass(Class<?> type)
Return true if the specified class is a Kotlin data class.
|
static boolean |
isSupportedKotlinClass(Class<?> type)
Return true if the specified class is a supported Kotlin class.
|
static boolean |
isSuspend(Method method)
Returns whether the
Method is declared as suspend (Kotlin Coroutine). |
public static boolean isSupportedKotlinClass(Class<?> type)
type
is a supported Kotlin class.public static boolean isDataClass(Class<?> type)
type
is a Kotlin data class.@Nullable public static kotlin.reflect.KFunction<?> findKotlinFunction(Method method)
KFunction
instance corresponding to the given Java Method
instance, or null
if
this method cannot be represented by a Kotlin function.method
- the method to look up.KFunction
or null
if the method cannot be looked up.public static boolean isSuspend(Method method)
Method
is declared as suspend (Kotlin Coroutine).method
- the method to inspect.KFunction.isSuspend()
public static Class<?> getReturnType(Method method)
return type
of a Kotlin Method
. Supports regular and suspended methods.method
- the method to inspect, typically any synthetic JVM Method
.Copyright © 2011–2021 Pivotal Software, Inc.. All rights reserved.