getOrElse

abstract fun <T> getOrElse(type: Class<T>, other: 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

the instance to use if the type has not been registered