All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jvmMain.io.kotest.mpp.fqn.kt Maven / Gradle / Ivy

There is a newer version: 4.0.7
Show newest version
package io.kotest.mpp

import kotlin.reflect.KClass
import kotlin.reflect.jvm.reflect

actual fun KClass<*>.fqn(): String? = this.qualifiedName
/**
 * Returns the annotations on this class or empty list if not supported
 */
actual fun KClass<*>.annotations(): List = this.annotations

/**
 * Returns true if this KClass is a data class.
 */
actual val  KClass.isDataClass: Boolean?
   get() = this.isData

/**
 * Returns the names of the parameters if supported. Eg, for `fun foo(a: String, b: Boolean)` on the JVM
 * it would return [a, b] and on unsupported platforms an empty list.
 */
actual val Function<*>.paramNames: List
   get() = reflect()?.parameters?.mapNotNull { it.name } ?: emptyList()




© 2015 - 2024 Weber Informatics LLC | Privacy Policy