Package com.google.inject.internal
Class RealMultibinder.PermitDuplicatesModule
- java.lang.Object
-
- com.google.inject.AbstractModule
-
- com.google.inject.internal.RealMultibinder.PermitDuplicatesModule
-
- All Implemented Interfaces:
Module
- Enclosing class:
- RealMultibinder<T>
private static class RealMultibinder.PermitDuplicatesModule extends AbstractModule
We install the permit duplicates configuration as its own binding, all by itself. This way, if only one of a multibinder's users remember to call permitDuplicates(), they're still permitted.This is like setting a global variable in the injector so that each instance of the multibinder will have the same value for permitDuplicates, even if it is only set on one of them.
-
-
Constructor Summary
Constructors Constructor Description PermitDuplicatesModule(Key<java.lang.Boolean> key)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
configure()
Configures aBinder
via the exposed methods.boolean
equals(java.lang.Object o)
int
hashCode()
-
Methods inherited from class com.google.inject.AbstractModule
addError, addError, addError, bind, bind, bind, bindConstant, binder, bindListener, bindListener, bindScope, configure, convertToTypes, currentStage, getMembersInjector, getMembersInjector, getProvider, getProvider, install, requestInjection, requestStaticInjection, requireBinding, requireBinding
-
-
-
-
Field Detail
-
key
private final Key<java.lang.Boolean> key
-
-
Constructor Detail
-
PermitDuplicatesModule
PermitDuplicatesModule(Key<java.lang.Boolean> key)
-
-
Method Detail
-
configure
protected void configure()
Description copied from class:AbstractModule
Configures aBinder
via the exposed methods.- Overrides:
configure
in classAbstractModule
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-