# toClass

@ JvmOverloads
@ 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

toClassOrNull

@ JvmOverloads
@ 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

Class.toClass
toClassOrNull

@ 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

toClassOrNull

#### Throws

TypeCastException

if the conversion fails.

fun Type . toClass (): Class < Any >

Convert Type to Class.

#### Return

Class

#### See also

toClass
toClassOrNull