Annotation Interface BindingIdentifier


@Documented @Retention(RUNTIME) @Target({METHOD,CONSTRUCTOR}) public @interface BindingIdentifier
Assigns an explicit identifier class to a binding so it can be referenced by OnlyUsedBy.

Apply this annotation to a @Provides method, @Binds method, or @Inject constructor. For @Inject constructors without this annotation, the bound class itself is used as the default identifier.

  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    The identifier class representing this binding for OnlyUsedBy.
  • Element Details

    • value

      Class<?> value
      The identifier class representing this binding for OnlyUsedBy.