forceGet<KInstance extends BaseKoreInstance> method

  1. @visibleForTesting
KInstance? forceGet<KInstance extends BaseKoreInstance>({
  1. int? index,
  2. String scope = BaseScopes.global,
})

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?;
}