get method
Retrieves the single object instance or throws if none or more than one found.
- NoSuchPodDefinitionException if no matching object exists.
- NoUniquePodDefinitionException if more than one matching object exists.
Implementation
@override
FutureOr<ObjectHolder<T>> get([List<ArgumentValue>? args]) async {
final it = stream().iterator();
if (!it.moveNext()) {
throw NoSuchPodDefinitionException.byType(Class<Object>());
}
final result = it.current;
if (it.moveNext()) {
throw NoUniquePodDefinitionException.byTypeWithCount(Class<Object>(), 2, "$T has more than 1 matching pod");
}
return result;
}