Package com.google.inject.spi
Interface ConvertedConstantBinding<T>
-
- All Superinterfaces:
Binding<T>
,Element
,HasDependencies
public interface ConvertedConstantBinding<T> extends Binding<T>, HasDependencies
A binding created from converting a bound instance to a new type. The source binding has the same binding annotation but a different type.- Since:
- 2.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Set<Dependency<?>>
getDependencies()
Returns a singleton set containing only the converted key.Key<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.-
Methods inherited from interface com.google.inject.Binding
acceptScopingVisitor, acceptTargetVisitor, getKey, getProvider
-
Methods inherited from interface com.google.inject.spi.Element
acceptVisitor, applyTo, getSource
-
-
-
-
Method Detail
-
getValue
T getValue()
Returns the converted value.
-
getTypeConverterBinding
TypeConverterBinding getTypeConverterBinding()
Returns the type converter binding used to convert the constant.- Since:
- 3.0
-
getSourceKey
Key<String> getSourceKey()
Returns the key for the source binding. That binding can be retrieved from an injector usingInjector.getBinding(key)
.
-
getDependencies
Set<Dependency<?>> getDependencies()
Returns a singleton set containing only the converted key.- Specified by:
getDependencies
in interfaceHasDependencies
- Returns:
- a possibly empty set
-
-