Nice, that worked.

How do I then go about getting the instance in question?

I.e. injector.getInstance( new TypeLiteral<ICache<Npc>>() {}); doesn't
work



On Apr 14, 2:09 pm, jordi <[email protected]> wrote:
> that's a java defect or not provided feature. instead use
> TypeLiteral<http://google-guice.googlecode.com/svn/trunk/latest-javadoc/com/googl...>
>
> your code should be something like :
>
> TypeLiteral<ICache<Npc>> inpc = new TypeLiteral<ICache<Npc>>() {};
> TypeLiteral<Cache<Npc>> npc = new TypeLiteral<Cache<Npc>>() {};
>
> bind(inpc).to(npc);
>
> and similar for the other binding
>
> hope this helps!
>
> jordi
>
> On Tue, Apr 14, 2009 at 10:57 PM, aemami <[email protected]> wrote:
>
> > Hi, I am trying to accomplish the following:
>
> > bind(ICache<Npc>.class).to(Cache<Npc>.class);
>
> > and
>
> > bind(IMyMapper<Npc>.class).to(NpcMapper.class);
>
> > This doesn't seem possible in Java, or is it?
>
> > Keep in mind I'm not a java guy, I'm used to using Ninject (which was
> > patterned after Google Guice) and C#.
>
> > Thanks
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to