forceGet<KInstance extends BaseKoreInstance> method
KInstance?
forceGet<KInstance extends BaseKoreInstance>({})
Forcibly tries to get instance for type
index - index for this instance
scope - string scope to get instance from
Implementation
@visibleForTesting
KInstance? forceGet<KInstance extends BaseKoreInstance>({
int? index,
String scope = BaseScopes.global,
}) {
return container.getObjectInScope(
type: KInstance.toString(),
scopeId: scope,
index: index ?? 0,
) as KInstance?;
}