Interface Module

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

    Modifier and Type Method Description
    void configure​(Binder binder)
    Called to create bindings, by using the given binder during injector creation.
  • Method Details

    • configure

      void configure​(Binder binder)
      Called to create bindings, by using the given binder during injector creation.
      Parameters:
      binder - the binder