# toClassOrNull

@ JvmOverloads
@ JvmName (name = "createOrNull")
fun String . toClassOrNull (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 or null if the class not found.

#### 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 = "createOrNullTyped")
fun < T : Any > String . toClassOrNull (loader: ClassLoader ? = null, initialize: Boolean = false): Class < T >?

Convert String class name to Class with ClassLoader and initialize.

#### Return

Class<T> or null if the class not found or type cast failed.

#### See also

Class.toClass
toClassOrNull

@ JvmName (name = "toClassTypedOrNull")
fun < T : Any > Type . toClassOrNull (): Class < T >?

Safely convert Type to Class or return null if it fails.

#### Receiver

the Type to be converted.

#### Return

Class<T> or null.

#### See also

toClass

fun Type . toClassOrNull (): Class < Any >?

Safely convert Type to Class or return null if it fails.

#### Return

Class or null.

#### See also

toClass
toClassOrNull