Пример #1
0
 @Override
 public T supply(Dependency<? super T> dependency, Injector injector) {
   Type<? super T> type = dependency.getType();
   Instance<? extends T> parametrized =
       instance.typed(
           instance
               .getType()
               .parametized(type.getParameters())
               .lowerBound(dependency.getType().isLowerBound()));
   return injector.resolve(dependency.instanced(parametrized));
 }
Пример #2
0
 @Override
 public T supply(Dependency<? super T> dependency, Injector injector) {
   return injector.resolve(dependency.instanced(instance));
 }