I've used Guice assisted injection and FactoryModuleBuilder to help construct adapter classes, where one class wraps another.
class MyClassWrapper implements SomeInterface {
interface MyClassWrapper.Factory {
MyClassWrapper create(MyClass myClass, Database db);
}
// ...
@Inject
private MyClassWrapper(@Assisted MyClass myClass, @Assisted Database db) {
// ...
}
}
Suppose I wanted to add another method signature to the MyClassWrapper.Factory interface:
List<MyClassWrapper> create(List<MyClass> myClass, Database db);
Can FactoryMethodBuilder figure out that I want to construct a list of MyClassWrapper objects from the list of MyClass objects? Or do I need to manually write the factory method implementation?