toClass

@JvmName(name = "create")
fun String.toClass(loader: ClassLoader? = null, initialize: Boolean = false): Class<Any>

Convert String class name to Class with ClassLoader and initialize.

Receiver

the class name to be converted.

Return

Class

Parameters

loader

ClassLoader to load the class, default is ClassLoaderProvider.classLoader.

initialize

whether to initialize the class with loader, default is false.

See also


@JvmName(name = "createTyped")
fun <T : Any> String.toClass(loader: ClassLoader? = null, initialize: Boolean = false): Class<T>

Convert String class name to Class with ClassLoader and initialize.

Return

Class<T>

See also


@JvmName(name = "toClassTyped")
fun <T : Any> Type.toClass(): Class<T>

Convert Type to Class.

Receiver

the Type to be converted.

Return

Class<T>

See also

Throws

if the conversion fails.


Convert Type to Class.

Return

Class

See also