getOrElseSupply

abstract fun <T> getOrElseSupply(type: Class<T>, other: Supplier<T>): T

Return an instance from the context if the type has been registered. The instance will be created if it hasn't been accessed previously.

Return

the instance

Parameters

<T>

the instance type

type

the instance type

other

a supplier for the instance to use if the type has not been registered