Package com.google.inject.internal
Class RealOptionalBinder.BindingSelection<T>
- java.lang.Object
-
- com.google.inject.internal.RealOptionalBinder.BindingSelection<T>
-
- Enclosing class:
- RealOptionalBinder<T>
private static final class RealOptionalBinder.BindingSelection<T> extends java.lang.ObjectA 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
Fields Modifier and Type Field Description (package private) BindingImpl<T>actualBindingprivate Key<T>actualBindingKeylazily allocated, bygetKeyForActualBinding().(package private) BindingImpl<T>bindingprivate java.lang.StringbindingNamelazily allocated, bygetBindingName().(package private) BindingImpl<T>defaultBindingprivate Key<T>defaultBindingKeylazily allocated, bygetKeyForDefaultBinding().private com.google.common.collect.ImmutableSet<Dependency<?>>dependenciesprivate booleaninitializedprivate Key<T>keyprivate static com.google.common.collect.ImmutableSet<Dependency<?>>MODULE_DEPENDENCIESprivate com.google.common.collect.ImmutableSet<Dependency<?>>providerDependencies
-
Constructor Summary
Constructors Constructor Description BindingSelection(Key<T> key)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) voidcheckNotInitialized()(package private) booleancontainsElement(Element element)Implementation ofOptionalBinderBinding.containsElement(com.google.inject.spi.Element).(package private) com.google.common.collect.ImmutableSet<Dependency<?>>dependencies()booleanequals(java.lang.Object o)(package private) BindingImpl<T>getActualBinding()(package private) BindingImpl<T>getBinding()private java.lang.StringgetBindingName()(package private) BindingImpl<T>getDefaultBinding()(package private) Dependency<?>getDependency()Returns the Dependency for the target binding, throws NoSuchElementException if no target exists.(package private) Key<T>getDirectKey()(package private) Key<T>getKeyForActualBinding()(package private) Key<T>getKeyForDefaultBinding()inthashCode()(package private) voidinitialize(InjectorImpl injector)(package private) com.google.common.collect.ImmutableSet<Dependency<?>>providerDependencies()
-
-
-
Field Detail
-
MODULE_DEPENDENCIES
private static final com.google.common.collect.ImmutableSet<Dependency<?>> MODULE_DEPENDENCIES
-
actualBinding
BindingImpl<T> actualBinding
-
defaultBinding
BindingImpl<T> defaultBinding
-
binding
BindingImpl<T> binding
-
initialized
private boolean initialized
-
dependencies
private com.google.common.collect.ImmutableSet<Dependency<?>> dependencies
-
providerDependencies
private com.google.common.collect.ImmutableSet<Dependency<?>> providerDependencies
-
bindingName
private java.lang.String bindingName
lazily allocated, bygetBindingName().
-
defaultBindingKey
private Key<T> defaultBindingKey
lazily allocated, bygetKeyForDefaultBinding().
-
actualBindingKey
private Key<T> actualBindingKey
lazily allocated, bygetKeyForActualBinding().
-
-
Method Detail
-
checkNotInitialized
void checkNotInitialized()
-
initialize
void initialize(InjectorImpl injector)
-
getBindingName
private java.lang.String 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
boolean containsElement(Element element)
Implementation ofOptionalBinderBinding.containsElement(com.google.inject.spi.Element).
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-