Class RealOptionalBinder.BindingSelection<T>

  • Enclosing class:
    RealOptionalBinder<T>

    private static final class RealOptionalBinder.BindingSelection<T>
    extends java.lang.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 Detail

      • MODULE_DEPENDENCIES

        private static final com.google.common.collect.ImmutableSet<Dependency<?>> MODULE_DEPENDENCIES
      • 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 java.lang.String bindingName
        lazily allocated, by getBindingName().
    • Constructor Detail

      • BindingSelection

        BindingSelection​(Key<T> key)
    • Method Detail

      • checkNotInitialized

        void checkNotInitialized()
      • checkBindingIsNotRecursive

        private void checkBindingIsNotRecursive​(Errors errors)
      • getKeyForDefaultBinding

        Key<T> getKeyForDefaultBinding()
      • getKeyForActualBinding

        Key<T> getKeyForActualBinding()
      • getDirectKey

        Key<T> getDirectKey()
      • getBindingName

        private java.lang.String getBindingName()
      • 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.

      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object