The following code is an example of a factory that produces a Bar given a Foo. The factory doesn\'t care what T is:
Bar
Foo
T
One option is to just write the BarFactory boilerplate by hand:
class BarImplFactory implements BarFactory { public Bar create(Foo f) { return new BarImpl(f); } }
The binding becomes
bind(BarFactory.class).to(BarImplFactory.class);