As a Multibinder, it acts as a factory for LinkedBindingBuilders for each of the set's elements. Each binding is given an annotation that identifies it as a part of this set.
As a Module, it installs the binding to the set itself. As a module, this implements equals() and hashcode() in order to trick Guice into executing its configure() method only once. That makes it so that multiple multibinders can be created for the same target collection, but only one is bound. Since the list of bindings is retrieved from the injector itself (and not the multibinder), each multibinder has access to all contributions from all multibinders.
As a Provider, this constructs the set instances.
We use a subclass to hide 'implements Module, Provider' from the public API.
| Modifier and Type | Class and Description |
|---|---|
| private abstract static class | RealMultibinder.
Base implement of |
| private static class | |
| private static class | RealMultibinder.
We install the permit duplicates configuration as its own binding, all by itself. |
| private static class | RealMultibinder.
Implementation of BaseFactory that exposes a collection of providers of the values in the set. |
| private static class | RealMultibinder.
Provider instance implementation that provides the actual set of values. |
| Modifier and Type | Field and Description |
|---|---|
| private final Binder | |
| private final RealMultibinder. |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public LinkedBindingBuilder | |
| pack-priv static <T> TypeLiteral | |
| pack-priv static <T> TypeLiteral | |
| public void | configure(Binder binder)
Implements com. binder.
|
| pack-priv boolean | |
| public boolean | equals(Object
the reference object with which to compare. o)Overrides java. |
| pack-priv TypeLiteral | |
| pack-priv Key | |
| pack-priv Key | |
| pack-priv String | |
| public int | |
| public static <T> RealMultibinder | |
| public void | |
| pack-priv boolean | |
| pack-priv static <T> TypeLiteral | |
| pack-priv static <T> TypeLiteral |