Package com.google.inject.internal
Class RealMultibinder.BaseFactory<ValueT,ProvidedT>
- java.lang.Object
-
- com.google.inject.internal.InternalProviderInstanceBindingImpl.Factory<ProvidedT>
-
- com.google.inject.internal.RealMultibinder.BaseFactory<ValueT,ProvidedT>
-
- All Implemented Interfaces:
InternalFactory<ProvidedT>,Provider<ProvidedT>,HasDependencies,javax.inject.Provider<ProvidedT>
- Direct Known Subclasses:
RealMultibinder.ExtensionRealMultibinderProvider,RealMultibinder.RealMultibinderCollectionOfProvidersProvider,RealMultibinder.RealMultibinderProvider
- Enclosing class:
- RealMultibinder<T>
private abstract static class RealMultibinder.BaseFactory<ValueT,ProvidedT> extends InternalProviderInstanceBindingImpl.Factory<ProvidedT>
Base implement ofInternalProviderInstanceBindingImpl.Factorythat works based on aRealMultibinder.BindingSelection, allowing provider instances for various bindings to be implemented with less duplication.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) RealMultibinder.BindingSelection<ValueT>bindingSelection(package private) java.util.function.Function<RealMultibinder.BindingSelection<ValueT>,com.google.common.collect.ImmutableSet<Dependency<?>>>dependenciesFn-
Fields inherited from class com.google.inject.internal.InternalProviderInstanceBindingImpl.Factory
provisionCallback
-
-
Constructor Summary
Constructors Constructor Description BaseFactory(RealMultibinder.BindingSelection<ValueT> bindingSelection, java.util.function.Function<RealMultibinder.BindingSelection<ValueT>,com.google.common.collect.ImmutableSet<Dependency<?>>> dependenciesFn)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description (package private) abstract voiddoInitialize()booleanequals(java.lang.Object obj)java.util.Set<Dependency<?>>getDependencies()Returns the known dependencies for this type.inthashCode()(package private) voidinitialize(InjectorImpl injector, Errors errors)A callback that allows for implementations to fetch dependencies on other bindings.-
Methods inherited from class com.google.inject.internal.InternalProviderInstanceBindingImpl.Factory
doProvision, get, get, getSource
-
-
-
-
Field Detail
-
dependenciesFn
final java.util.function.Function<RealMultibinder.BindingSelection<ValueT>,com.google.common.collect.ImmutableSet<Dependency<?>>> dependenciesFn
-
bindingSelection
final RealMultibinder.BindingSelection<ValueT> bindingSelection
-
-
Constructor Detail
-
BaseFactory
BaseFactory(RealMultibinder.BindingSelection<ValueT> bindingSelection, java.util.function.Function<RealMultibinder.BindingSelection<ValueT>,com.google.common.collect.ImmutableSet<Dependency<?>>> dependenciesFn)
-
-
Method Detail
-
initialize
void initialize(InjectorImpl injector, Errors errors) throws ErrorsException
Description copied from class:InternalProviderInstanceBindingImpl.FactoryA callback that allows for implementations to fetch dependencies on other bindings.Will be called exactly once, prior to any call to
InternalProviderInstanceBindingImpl.Factory.doProvision(com.google.inject.internal.InternalContext, com.google.inject.spi.Dependency<?>).- Specified by:
initializein classInternalProviderInstanceBindingImpl.Factory<ProvidedT>- Throws:
ErrorsException
-
doInitialize
abstract void doInitialize()
-
getDependencies
public java.util.Set<Dependency<?>> getDependencies()
Description copied from interface:HasDependenciesReturns the known dependencies for this type. If this has dependencies whose values are not known statically, a dependency for theInjectorwill be included in the returned set.- Returns:
- a possibly empty set
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-