Modifier and Type | Class and Description |
---|---|
(package private) static interface |
RealOptionalBinder.Actual |
(package private) static class |
RealOptionalBinder.ActualImpl |
(package private) static class |
RealOptionalBinder.BaseAnnotation |
private static class |
RealOptionalBinder.BindingSelection<T>
A helper object that implements the core logic for deciding what the implementation of the
binding will be.
|
(package private) static interface |
RealOptionalBinder.Default |
(package private) static class |
RealOptionalBinder.DefaultImpl |
private static class |
RealOptionalBinder.JavaOptionalProvider<T>
Provides the binding for java.util.Optional
|
private static class |
RealOptionalBinder.JavaOptionalProviderProvider<T>
Provides the binding for java.util.Optional
|
private static class |
RealOptionalBinder.RealDirectTypeProvider<T>
Provides the binding for T, conditionally installed by calling setBinding/setDefault.
|
private 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
|
private static class |
RealOptionalBinder.RealOptionalProviderProvider<T>
Provides the binding for Optional
|
(package private) static class |
RealOptionalBinder.Source |
Modifier and Type | Field and Description |
---|---|
private Binder |
binder |
private RealOptionalBinder.BindingSelection<T> |
bindingSelection |
Modifier | Constructor and Description |
---|---|
private |
RealOptionalBinder(Binder binder,
Key<T> typeKey) |
Modifier and Type | Method and Description |
---|---|
private void |
addDirectTypeBinding(Binder binder)
Adds a binding for T.
|
void |
configure(Binder binder)
Contributes bindings and other configurations for this module to
binder . |
boolean |
equals(java.lang.Object o) |
(package private) Key<T> |
getKeyForActualBinding()
Returns the key to use for the actual binding, overrides the default if set.
|
(package private) Key<T> |
getKeyForDefaultBinding()
Returns the key to use for the default binding.
|
int |
hashCode() |
(package private) static <T> TypeLiteral<java.util.Optional<T>> |
javaOptionalOf(TypeLiteral<T> type) |
(package private) static <T> TypeLiteral<java.util.Optional<javax.inject.Provider<T>>> |
javaOptionalOfJavaxProvider(TypeLiteral<T> type) |
(package private) static <T> TypeLiteral<java.util.Optional<Provider<T>>> |
javaOptionalOfProvider(TypeLiteral<T> type) |
static <T> RealOptionalBinder<T> |
newRealOptionalBinder(Binder binder,
Key<T> type) |
(package private) static <T> TypeLiteral<com.google.common.base.Optional<T>> |
optionalOf(TypeLiteral<T> type) |
(package private) static <T> TypeLiteral<com.google.common.base.Optional<javax.inject.Provider<T>>> |
optionalOfJavaxProvider(TypeLiteral<T> type) |
(package private) static <T> TypeLiteral<com.google.common.base.Optional<Provider<T>>> |
optionalOfProvider(TypeLiteral<T> type) |
(package private) static <T> Key<Provider<T>> |
providerOf(Key<T> key) |
LinkedBindingBuilder<T> |
setBinding() |
LinkedBindingBuilder<T> |
setDefault() |
private final RealOptionalBinder.BindingSelection<T> bindingSelection
private final Binder binder
public static <T> RealOptionalBinder<T> newRealOptionalBinder(Binder binder, Key<T> type)
static <T> TypeLiteral<com.google.common.base.Optional<T>> optionalOf(TypeLiteral<T> type)
static <T> TypeLiteral<java.util.Optional<T>> javaOptionalOf(TypeLiteral<T> type)
static <T> TypeLiteral<com.google.common.base.Optional<javax.inject.Provider<T>>> optionalOfJavaxProvider(TypeLiteral<T> type)
static <T> TypeLiteral<java.util.Optional<javax.inject.Provider<T>>> javaOptionalOfJavaxProvider(TypeLiteral<T> type)
static <T> TypeLiteral<com.google.common.base.Optional<Provider<T>>> optionalOfProvider(TypeLiteral<T> type)
static <T> TypeLiteral<java.util.Optional<Provider<T>>> javaOptionalOfProvider(TypeLiteral<T> type)
private void addDirectTypeBinding(Binder binder)
Key<T> getKeyForDefaultBinding()
As a side effect this installs support for the 'direct type', so a binding for T
will be made available.
public LinkedBindingBuilder<T> setDefault()
Key<T> getKeyForActualBinding()
As a side effect this installs support for the 'direct type', so a binding for T
will be made available.
public LinkedBindingBuilder<T> setBinding()
public void configure(Binder binder)
Module
binder
.
Do not invoke this method directly to install submodules. Instead use
Binder.install(Module)
, which ensures that provider methods
are
discovered.
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object