asTypeName

fun KType.asTypeName(): TypeName

Returns a TypeName equivalent to the given Kotlin KType using reflection, maybe using kotlin-reflect if required.

@DelicateKotlinPoetApi(message = "Mirror APIs don't give complete information on Kotlin types. Consider using the kotlinpoet-metadata APIs instead.")
@JvmName(name = "get")
fun TypeMirror.asTypeName(): TypeName

Returns a TypeName equivalent to this TypeMirror.

@JvmName(name = "get")
fun KClass<*>.asTypeName(): ClassName

Returns a TypeName equivalent to this KClass.

@JvmName(name = "get")
fun Type.asTypeName(): TypeName

Returns a TypeName equivalent to this Type.