convert

abstract fun <FROM : Any, TO : Any> convert(from: KClass<FROM>? = null, instance: FROM, to: KClass<TO>): TO(source)

Convert an instance type.

Throws

if it cannot be converted.