Package dagger.model

Class DependencyRequest

  • public abstract class DependencyRequest
    extends java.lang.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 Detail

      • DependencyRequest

        public DependencyRequest()
    • Method Detail

      • kind

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

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

        public abstract java.util.Optional<javax.lang.model.element.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.