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 voidconfigure()Configures aBindervia the exposed methods.booleanequals(java.lang.Object o)inthashCode()-
Methods inherited from class com.google.inject.AbstractModule
addError, addError, addError, bind, bind, bind, bindConstant, binder, bindInterceptor, 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:AbstractModuleConfigures aBindervia the exposed methods.- Overrides:
configurein classAbstractModule
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-