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 Object
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 Details

    • 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
    • key

      private final Key<T> key
    • dependencies

      private com.google.common.collect.ImmutableSet<Dependency<?>> dependencies
    • providerDependencies

      private com.google.common.collect.ImmutableSet<Dependency<?>> providerDependencies
    • bindingName

      private String bindingName
      lazily allocated, by getBindingName().
    • defaultBindingKey

      private Key<T> defaultBindingKey
      lazily allocated, by getKeyForDefaultBinding().
    • actualBindingKey

      private Key<T> actualBindingKey
      lazily allocated, by getKeyForActualBinding().
  • Constructor Details

    • BindingSelection

      BindingSelection(Key<T> key)
  • Method Details

    • checkNotInitialized

      void checkNotInitialized()
    • initialize

      void initialize(InjectorImpl injector)
    • getKeyForDefaultBinding

      Key<T> getKeyForDefaultBinding()
    • getKeyForActualBinding

      Key<T> getKeyForActualBinding()
    • getDirectKey

      Key<T> getDirectKey()
    • getBindingName

      private 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() returns null.

    • containsElement

      boolean containsElement(Element element)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object