create

fun <T> create(clazz: Class<out T>, fallback: () -> T): T

Create an instance of clazz

Return

a new instance of clazz or fallback

Parameters

clazz

the clazz to create an instance of

fallback

a value provider which provides a fallback in case of a failure

the return type

fun <T> create(clazz: Class<out T?>): T?


fun <T> create(classes: Collection<Class<out T>>): List<T>

Create instances of the given classes

Return

a list of successfully created instances, does not contain null

Parameters

classes

the classes to create insatnces of

the return type