Package com.google.inject.internal
Class RealOptionalBinder.BindingSelection<T>
java.lang.Object
com.google.inject.internal.RealOptionalBinder.BindingSelection<T>
- Enclosing class:
- RealOptionalBinder<T>
A helper object that implements the core logic for deciding what the implementation of the
binding will be.
This also implements the main OptionalBinderBinding logic.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) BindingImpl<T>
lazily allocated, bygetKeyForActualBinding()
.(package private) BindingImpl<T>
private String
lazily allocated, bygetBindingName()
.(package private) BindingImpl<T>
lazily allocated, bygetKeyForDefaultBinding()
.private com.google.common.collect.ImmutableSet<Dependency<?>>
private boolean
private static final com.google.common.collect.ImmutableSet<Dependency<?>>
private com.google.common.collect.ImmutableSet<Dependency<?>>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) void
(package private) boolean
containsElement
(Element element) Implementation ofOptionalBinderBinding.containsElement(com.google.inject.spi.Element)
.(package private) com.google.common.collect.ImmutableSet<Dependency<?>>
boolean
(package private) BindingImpl<T>
(package private) BindingImpl<T>
private String
(package private) BindingImpl<T>
(package private) Dependency<?>
Returns the Dependency for the target binding, throws NoSuchElementException if no target exists.int
hashCode()
(package private) void
initialize
(InjectorImpl injector) (package private) com.google.common.collect.ImmutableSet<Dependency<?>>
-
Field Details
-
MODULE_DEPENDENCIES
-
actualBinding
BindingImpl<T> actualBinding -
defaultBinding
BindingImpl<T> defaultBinding -
binding
BindingImpl<T> binding -
initialized
private boolean initialized -
key
-
dependencies
-
providerDependencies
-
bindingName
lazily allocated, bygetBindingName()
. -
defaultBindingKey
lazily allocated, bygetKeyForDefaultBinding()
. -
actualBindingKey
lazily allocated, bygetKeyForActualBinding()
.
-
-
Constructor Details
-
BindingSelection
-
-
Method Details
-
checkNotInitialized
void checkNotInitialized() -
initialize
-
getKeyForDefaultBinding
-
getKeyForActualBinding
-
getDirectKey
-
getBindingName
-
getBinding
BindingImpl<T> getBinding() -
getDefaultBinding
BindingImpl<T> getDefaultBinding() -
getActualBinding
BindingImpl<T> getActualBinding() -
providerDependencies
com.google.common.collect.ImmutableSet<Dependency<?>> providerDependencies() -
dependencies
com.google.common.collect.ImmutableSet<Dependency<?>> dependencies() -
getDependency
Dependency<?> getDependency()Returns the Dependency for the target binding, throws NoSuchElementException if no target exists.Calls to this method should typically be guarded by checking if
getBinding()
returnsnull
. -
containsElement
Implementation ofOptionalBinderBinding.containsElement(com.google.inject.spi.Element)
. -
equals
-
hashCode
public int hashCode()
-