Package dagger.model

Class DependencyRequest

java.lang.Object
dagger.model.DependencyRequest

public abstract class DependencyRequest extends Object
Represents a request for a Key at an injection point. For example, parameters to Inject constructors, Provides methods, and component methods are all dependency requests.

A dependency request is considered to be synthetic if it does not have an Element in code that requests the key directly. For example, an Executor is required for all @Produces methods to run asynchronously even though it is not directly specified as a parameter to the binding method.

  • Constructor Details

    • DependencyRequest

      public DependencyRequest()
  • Method Details

    • kind

      public abstract RequestKind kind()
      The kind of this request.
    • key

      public abstract Key key()
      The key of this request.
    • requestElement

      public abstract Optional<Element> requestElement()
      The element that declares this dependency request. Absent for synthetic requests.
    • isNullable

      public abstract boolean isNullable()
      Returns true if this request allows null objects. A request is nullable if it is has an annotation with "Nullable" as its simple name.
    • builder

      public static DependencyRequest.Builder builder()
      Returns a new builder of dependency requests.