@Override public Class<?> getProvidedType() { return instantiator.getType(); }
@Override public Class getType() { return delegate.getType(); } }
@SuppressWarnings("unchecked") @Override public Class<?> getType() { return Types.getProvidedType(providerInstantiator.getType()); } }
/** * Flatten an instnatiator of providers into an instantiator of the provided type. Any * exception thrown by the provider - including a runtime exception - is wrapped in an * {@link ConstructionException}. * @param pinst The providerInstantiator instantiator to wrap. * @return An instantiator wrapping {@code providerInstantiator}. */ public static Instantiator ofProviderInstantiator(Instantiator pinst) { Preconditions.checkNotNull(pinst, "provider instantiator"); Preconditions.checkArgument(Provider.class.isAssignableFrom(pinst.getType()), "instantiator is not of type Provider"); return new ProviderInstantiator(pinst); }