public final class

DependencyAndSource

extends Object
java.lang.Object
   ↳ com.google.inject.spi.DependencyAndSource

Class Overview

A combination of a Dependency and the source where the dependency was bound.

Summary

Public Constructors
DependencyAndSource(Dependency<?> dependency, Object source)
Public Methods
String getBindingSource()
Returns a string describing where this dependency was bound.
Dependency<?> getDependency()
Returns the Dependency, if one exists.
String toString()
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public DependencyAndSource (Dependency<?> dependency, Object source)

Public Methods

public String getBindingSource ()

Returns a string describing where this dependency was bound. If the binding was just-in-time, there is no valid binding source, so this describes the class in question.

public Dependency<?> getDependency ()

Returns the Dependency, if one exists. For anything that can be referenced by Injector#getBinding, a dependency exists. A dependency will not exist (and this will return null) for types initialized with Binder#requestInjection or {@link Injector#injectMembers(Object), nor will it exist for objects injected into Providers bound with LinkedBindingBuilder#toProvider(Provider).

public String toString ()