bind( new TypeLiteral<Set<String>>(){} ).to( MyCustomStringSet.class )
Then you can
@Inject SomeClass( Set<String> strings ) { ..... }
@Inject SomeClass( Provider<Set<String>> stringProvider ) { ..... }
of course, toInstance, toProvider, work too, it's the TypeLiteral
that's the magic.
-d
On Dec 12, 3:50 pm, Grary <[email protected]> wrote:
> Folks,
>
> I want to provide multiple instances of
> java.util.Set<java.lang.String> in my class, but I just can't seem to
> get it to work with Guice's Provider<T>.
>
> There seems to be a hole in the documentation as far the following key
> steps are concerned:
>
> 1) Can Provider<T> be implemented where T is a generic class?
> 2) If so, how does the binding look?
>
> Any thoughts?
>
> Thanks,
>
> Grar
--
You received this message because you are subscribed to the Google Groups
"google-guice" group.
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.