Package com.google.inject.internal
Class RealMapBinder.RealMultimapBinderProviderWithDependencies<K,V,P>
- java.lang.Object
-
- com.google.inject.internal.InternalProviderInstanceBindingImpl.Factory<P>
-
- com.google.inject.internal.RealMapBinder.RealMultimapBinderProviderWithDependencies<K,V,P>
-
- All Implemented Interfaces:
InternalFactory<P>
,Provider<P>
,HasDependencies
,javax.inject.Provider<P>
- Direct Known Subclasses:
RealMapBinder.MultimapBinder.RealMultimapProvider
,RealMapBinder.MultimapBinder.RealProviderMultimapProvider
- Enclosing class:
- RealMapBinder<K,V>
private abstract static class RealMapBinder.RealMultimapBinderProviderWithDependencies<K,V,P> extends InternalProviderInstanceBindingImpl.Factory<P>
A base class for ProviderWithDependencies that need equality based on a specific object.This differs from
RealMapBinder.RealMapBinderProviderWithDependencies
in that it gets thebindingSelection
from the injector at initialization time, rather than in the constructor. This is done to allow all the providers to operate on the same instance of theRealMapBinder.BindingSelection
.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) RealMapBinder.BindingSelection<K,V>
bindingSelection
(package private) Key<java.util.Map<K,V>>
mapKey
-
Fields inherited from class com.google.inject.internal.InternalProviderInstanceBindingImpl.Factory
provisionCallback
-
-
Constructor Summary
Constructors Modifier Constructor Description private
RealMultimapBinderProviderWithDependencies(Key<java.util.Map<K,V>> mapKey)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description (package private) abstract void
doInitialize(InjectorImpl injector, Errors errors)
Initialize the factory.boolean
equals(java.lang.Object obj)
int
hashCode()
(package private) void
initialize(InjectorImpl injector, Errors errors)
This will get the authoritativeRealMapBinder.BindingSelection
from the map provider.-
Methods inherited from class com.google.inject.internal.InternalProviderInstanceBindingImpl.Factory
doProvision, get, get, getSource
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.google.inject.spi.HasDependencies
getDependencies
-
-
-
-
Method Detail
-
initialize
final void initialize(InjectorImpl injector, Errors errors) throws ErrorsException
This will get the authoritativeRealMapBinder.BindingSelection
from the map provider. This guarantees that everyone has the same instance of the bindingSelection and sees consistent state.- Specified by:
initialize
in classInternalProviderInstanceBindingImpl.Factory<P>
- Throws:
ErrorsException
-
doInitialize
abstract void doInitialize(InjectorImpl injector, Errors errors) throws ErrorsException
Initialize the factory. BindingSelection is guaranteed to be initialized at this point and this will be called prior to any provisioning.- Throws:
ErrorsException
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-