- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface Module
A module contributes configuration information, typically interface bindings, which will be used to create an
Injector
. For ex:
Module module = binder -> {
binder.bind(Service.class).to(ServiceImpl.class).in(Singleton.class);
...
};
Injector injector = Injectors.create(module);
Service service = injector.getInstance(Service.class);
-
Method Summary
-
Method Details
-
configure
Called to create bindings, by using the givenbinder
during injector creation.- Parameters:
binder
- the binder
-