Package com.google.inject.internal
Class RealOptionalBinder.JavaOptionalProviderProvider
- java.lang.Object
-
- com.google.inject.internal.InternalProviderInstanceBindingImpl.Factory<P>
-
- com.google.inject.internal.RealOptionalBinder.RealOptionalBinderProviderWithDependencies
-
- com.google.inject.internal.RealOptionalBinder.JavaOptionalProviderProvider
-
- All Implemented Interfaces:
InternalFactory
,Provider
,HasDependencies
,javax.inject.Provider
- Enclosing class:
- RealOptionalBinder<T>
private static final class RealOptionalBinder.JavaOptionalProviderProvider extends RealOptionalBinder.RealOptionalBinderProviderWithDependencies
Provides the binding for java.util.Optional>.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Object
value
-
Fields inherited from class com.google.inject.internal.RealOptionalBinder.RealOptionalBinderProviderWithDependencies
bindingSelection
-
Fields inherited from class com.google.inject.internal.InternalProviderInstanceBindingImpl.Factory
provisionCallback
-
-
Constructor Summary
Constructors Constructor Description JavaOptionalProviderProvider(RealOptionalBinder.BindingSelection<?> bindingSelection)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) void
doInitialize()
Initialize the factory.protected java.lang.Object
doProvision(InternalContext context, Dependency dependency)
Creates an object to be injected.java.util.Set<Dependency<?>>
getDependencies()
Returns the known dependencies for this type.-
Methods inherited from class com.google.inject.internal.RealOptionalBinder.RealOptionalBinderProviderWithDependencies
equals, hashCode, initialize
-
Methods inherited from class com.google.inject.internal.InternalProviderInstanceBindingImpl.Factory
get, get, getSource
-
-
-
-
Constructor Detail
-
JavaOptionalProviderProvider
JavaOptionalProviderProvider(RealOptionalBinder.BindingSelection<?> bindingSelection)
-
-
Method Detail
-
doInitialize
void doInitialize()
Description copied from class:RealOptionalBinder.RealOptionalBinderProviderWithDependencies
Initialize the factory. BindingSelection is guaranteed to be initialized at this point and this will be called prior to any provisioning.- Specified by:
doInitialize
in classRealOptionalBinder.RealOptionalBinderProviderWithDependencies
-
doProvision
protected java.lang.Object doProvision(InternalContext context, Dependency dependency)
Description copied from class:InternalProviderInstanceBindingImpl.Factory
Creates an object to be injected.- Specified by:
doProvision
in classInternalProviderInstanceBindingImpl.Factory
- Returns:
- instance to be injected
-
getDependencies
public java.util.Set<Dependency<?>> getDependencies()
Description copied from interface:HasDependencies
Returns the known dependencies for this type. If this has dependencies whose values are not known statically, a dependency for theInjector
will be included in the returned set.- Returns:
- a possibly empty set
-
-