If doable, this would sure be more readable than the ten copies of the 
concrete code complete with long-named types duplicated three times in each 
copy.  How would one write a custom utility like you mentioned?  Aren't you 
just re-posing the question implemented as a method chain?  Or does using a 
method chain somehow help solve the problem in a way that I'm missing?

On Thursday, May 10, 2012 11:47:08 AM UTC-5, Alen Vrečko wrote:
>
> Assisted inject must figure out the real class. It can't figure it out 
> from a parameterized type parameter. 
>
> If you want to save some keystrokes you can go with a custom "utility" 
> like: 
>
> useAssisedInjectFor(Foo.class).using(BarFactory.class); 
> useAssisedInjectFor(Foo.class).generifiedWith(Baz.class).using(BarFactory.class);
>  
>
>
> or similar. But I doubt this will give much added value. 
>
> Cheers 
> Alen 
>
> On May 10, 6:08 pm, glenviewjeff <[email protected]> wrote: 
> > I'd like to know how to represent a generic version of the following 
> > binding that won't fail with xxx cannot be used as a key it is not fully 
> > specified 
> > 
> > install(new FactoryModuleBuilder(). 
> >    implement(new TypeLiteral<SomeClass<T,?>>(){}, 
> >       new TypeLiteral<SomeOtherClass<T, U>>(){}). 
> >    build(new TypeLiteral<SomeFactory<T>>(){})); 
> > 
> > It seems that the implement method isn't available with a parameterized 
> > type parameter. 
> > 
> > Thanks, 
> > Jeff

-- 
You received this message because you are subscribed to the Google Groups 
"google-guice" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-guice/-/zeB2eUYY3ksJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-guice?hl=en.

Reply via email to