private abstract static class RealMultibinder.BaseFactory<ValueT,ProvidedT> extends InternalProviderInstanceBindingImpl.Factory<ProvidedT>
InternalProviderInstanceBindingImpl.Factory
that works based on a
RealMultibinder.BindingSelection
, allowing provider instances for various bindings to be implemented
with less duplication.Modifier and Type | Field and Description |
---|---|
(package private) RealMultibinder.BindingSelection<ValueT> |
bindingSelection |
(package private) java.util.function.Function<RealMultibinder.BindingSelection<ValueT>,com.google.common.collect.ImmutableSet<Dependency<?>>> |
dependenciesFn |
provisionCallback
Constructor and Description |
---|
BaseFactory(RealMultibinder.BindingSelection<ValueT> bindingSelection,
java.util.function.Function<RealMultibinder.BindingSelection<ValueT>,com.google.common.collect.ImmutableSet<Dependency<?>>> dependenciesFn) |
Modifier and Type | Method and Description |
---|---|
(package private) abstract void |
doInitialize() |
boolean |
equals(java.lang.Object obj) |
java.util.Set<Dependency<?>> |
getDependencies()
Returns the known dependencies for this type.
|
int |
hashCode() |
(package private) void |
initialize(InjectorImpl injector,
Errors errors)
A callback that allows for implementations to fetch dependencies on other bindings.
|
doProvision, get, get, getSource
final java.util.function.Function<RealMultibinder.BindingSelection<ValueT>,com.google.common.collect.ImmutableSet<Dependency<?>>> dependenciesFn
final RealMultibinder.BindingSelection<ValueT> bindingSelection
BaseFactory(RealMultibinder.BindingSelection<ValueT> bindingSelection, java.util.function.Function<RealMultibinder.BindingSelection<ValueT>,com.google.common.collect.ImmutableSet<Dependency<?>>> dependenciesFn)
void initialize(InjectorImpl injector, Errors errors) throws ErrorsException
InternalProviderInstanceBindingImpl.Factory
Will be called exactly once, prior to any call to InternalProviderInstanceBindingImpl.Factory.doProvision(com.google.inject.internal.InternalContext, com.google.inject.spi.Dependency<?>)
.
initialize
in class InternalProviderInstanceBindingImpl.Factory<ProvidedT>
ErrorsException
abstract void doInitialize()
public java.util.Set<Dependency<?>> getDependencies()
HasDependencies
Injector
will be
included in the returned set.public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object