Top Description Inners Fields Constructors Methods
com.google.inject.internal

public final Class RealOptionalBinder<T>

extends Object
implements Module
Class Inheritance
All Implemented Interfaces
com.google.inject.Module
Static Imports
com.google.common.base.Preconditions.checkNotNull, com.google.inject.internal.Errors.checkConfiguration, com.google.inject.util.Types.newParameterizedType, java.lang.annotation.RetentionPolicy.RUNTIME

The actual OptionalBinder plays several roles. It implements Module to hide that fact from the public API, and installs the various bindings that are exposed to the user.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static @interface
pack-priv static class
pack-priv abstract static class
private static class
RealOptionalBinder.BindingSelection<T>

A helper object that implements the core logic for deciding what the implementation of the binding will be.

pack-priv static @interface
pack-priv static class
private static class
RealOptionalBinder.JavaOptionalProvider<T>

Provides the binding for java.util.Optional<T>.

private static class
RealOptionalBinder.JavaOptionalProviderProvider<T>

Provides the binding for java.util.Optional<Provider<T>>.

private static class
RealOptionalBinder.RealDirectTypeProvider<T>

Provides the binding for T, conditionally installed by calling setBinding/setDefault.

private abstract static class
RealOptionalBinder.RealOptionalBinderProviderWithDependencies<T, P>

A base class for ProviderWithDependencies that need equality based on a specific object.

private static class
RealOptionalBinder.RealOptionalKeyProvider<T>

Provides the binding for Optional<T>.

private static class
RealOptionalBinder.RealOptionalProviderProvider<T>

Provides the binding for Optional<Provider<T>>.

pack-priv static enum

Field Summary

Modifier and TypeField and Description
private final Binder
private final RealOptionalBinder.BindingSelection<T>

Constructor Summary

AccessConstructor and Description
private
RealOptionalBinder(Binder binder, Key<T> typeKey)

Method Summary

Modifier and TypeMethod and Description
private void
addDirectTypeBinding(Binder binder)

Adds a binding for T.

public void
configure(Binder binder)

Implements com.google.inject.Module.configure.

Contributes bindings and other configurations for this module to binder.
public boolean
equals(Object
the reference object with which to compare.
o
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.
pack-priv Key<T>
getKeyForActualBinding()

Returns the key to use for the actual binding, overrides the default if set.

pack-priv Key<T>
getKeyForDefaultBinding()

Returns the key to use for the default binding.

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.
pack-priv static <T> TypeLiteral<Optional<T>>
pack-priv static <T> TypeLiteral<Optional<Provider<T>>>
pack-priv static <T> TypeLiteral<Optional<Provider<T>>>
public static <T> RealOptionalBinder<T>
newRealOptionalBinder(Binder binder, Key<T> type)

pack-priv static <T> TypeLiteral<Optional<T>>
pack-priv static <T> TypeLiteral<Optional<Provider<T>>>
pack-priv static <T> TypeLiteral<Optional<Provider<T>>>
pack-priv static <T> Key<Provider<T>>
providerOf(Key<T> key)

public LinkedBindingBuilder<T>
public LinkedBindingBuilder<T>
Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAlltoStringwaitwaitwait