Package com.google.inject.internal
Class InjectorImpl.ConvertedConstantBindingImpl<T>
- java.lang.Object
-
- com.google.inject.internal.BindingImpl<T>
-
- com.google.inject.internal.InjectorImpl.ConvertedConstantBindingImpl<T>
-
- All Implemented Interfaces:
Binding<T>
,ConvertedConstantBinding<T>
,Element
,HasDependencies
- Enclosing class:
- InjectorImpl
private static class InjectorImpl.ConvertedConstantBindingImpl<T> extends BindingImpl<T> implements ConvertedConstantBinding<T>
-
-
Field Summary
Fields Modifier and Type Field Description (package private) Binding<java.lang.String>
originalBinding
(package private) Provider<T>
provider
(package private) TypeConverterBinding
typeConverterBinding
(package private) T
value
-
Constructor Summary
Constructors Constructor Description ConvertedConstantBindingImpl(InjectorImpl injector, Key<T> key, T value, Binding<java.lang.String> originalBinding, TypeConverterBinding typeConverterBinding)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <V> V
acceptTargetVisitor(BindingTargetVisitor<? super T,V> visitor)
Accepts a target visitor.void
applyTo(Binder binder)
Writes this module element to the given binder (optional operation).boolean
equals(java.lang.Object obj)
java.util.Set<Dependency<?>>
getDependencies()
Returns a singleton set containing only the converted key.Provider<T>
getProvider()
Returns the scoped provider guice uses to fulfill requests for this binding.Key<java.lang.String>
getSourceKey()
Returns the key for the source binding.TypeConverterBinding
getTypeConverterBinding()
Returns the type converter binding used to convert the constant.T
getValue()
Returns the converted value.int
hashCode()
java.lang.String
toString()
-
Methods inherited from class com.google.inject.internal.BindingImpl
acceptScopingVisitor, acceptVisitor, getInjector, getInternalFactory, getKey, getScoping, getSource, isConstant, withKey, withScoping
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.google.inject.Binding
acceptScopingVisitor, getKey
-
Methods inherited from interface com.google.inject.spi.Element
acceptVisitor, getSource
-
-
-
-
Field Detail
-
value
final T value
-
originalBinding
final Binding<java.lang.String> originalBinding
-
typeConverterBinding
final TypeConverterBinding typeConverterBinding
-
-
Constructor Detail
-
ConvertedConstantBindingImpl
ConvertedConstantBindingImpl(InjectorImpl injector, Key<T> key, T value, Binding<java.lang.String> originalBinding, TypeConverterBinding typeConverterBinding)
-
-
Method Detail
-
getProvider
public Provider<T> getProvider()
Description copied from interface:Binding
Returns the scoped provider guice uses to fulfill requests for this binding.- Specified by:
getProvider
in interfaceBinding<T>
- Overrides:
getProvider
in classBindingImpl<T>
-
acceptTargetVisitor
public <V> V acceptTargetVisitor(BindingTargetVisitor<? super T,V> visitor)
Description copied from interface:Binding
Accepts a target visitor. Invokes the visitor method specific to this binding's target.- Specified by:
acceptTargetVisitor
in interfaceBinding<T>
- Parameters:
visitor
- to call back on
-
getValue
public T getValue()
Description copied from interface:ConvertedConstantBinding
Returns the converted value.- Specified by:
getValue
in interfaceConvertedConstantBinding<T>
-
getTypeConverterBinding
public TypeConverterBinding getTypeConverterBinding()
Description copied from interface:ConvertedConstantBinding
Returns the type converter binding used to convert the constant.- Specified by:
getTypeConverterBinding
in interfaceConvertedConstantBinding<T>
-
getSourceKey
public Key<java.lang.String> getSourceKey()
Description copied from interface:ConvertedConstantBinding
Returns the key for the source binding. That binding can be retrieved from an injector usingInjector.getBinding(key)
.- Specified by:
getSourceKey
in interfaceConvertedConstantBinding<T>
-
getDependencies
public java.util.Set<Dependency<?>> getDependencies()
Description copied from interface:ConvertedConstantBinding
Returns a singleton set containing only the converted key.- Specified by:
getDependencies
in interfaceConvertedConstantBinding<T>
- Specified by:
getDependencies
in interfaceHasDependencies
- Returns:
- a possibly empty set
-
applyTo
public void applyTo(Binder binder)
Description copied from interface:Element
Writes this module element to the given binder (optional operation).
-
toString
public java.lang.String toString()
- Overrides:
toString
in classBindingImpl<T>
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-