public final class DependencyAndSource extends Object
Dependency
and the source
where the dependency was bound.Constructor and Description |
---|
DependencyAndSource(Dependency<?> dependency,
Object source) |
Modifier and Type | Method and Description |
---|---|
String |
getBindingSource()
Returns a string describing where this dependency was bound.
|
Dependency<?> |
getDependency()
Returns the Dependency, if one exists.
|
String |
toString() |
public DependencyAndSource(Dependency<?> dependency, Object source)
public Dependency<?> getDependency()
Injector.getBinding(com.google.inject.Key<T>)
, a dependency exists. A dependency will not
exist (and this will return null) for types initialized with
Binder.requestInjection(com.google.inject.TypeLiteral<T>, T)
or Injector.injectMembers(Object)
,
nor will it exist for objects injected into Providers bound with
LinkedBindingBuilder#toProvider(Provider).public String getBindingSource()