Annotation Type Provides
@Documented @Target(METHOD) @Retention(RUNTIME) public @interface ProvidesAnnotates methods of a module to create a provider method binding. The method's return type is bound to its returned value. The component implementation will pass dependencies to the method as parameters.
Dagger forbids injecting
nullby default. Component implementations that invoke
@Providesmethods that return
nullwill throw a
@Providesmethods may opt into allowing
nullby annotating the method with any
@Providesmethod is marked
@Nullable, Dagger will only allow injection into sites that are marked
@Nullableas well. A component that attempts to pair a
@Nullableprovision with a non-
@Nullableinjection site will fail to compile.