Annotation Interface AliasOf


@Target(ANNOTATION_TYPE) @Retention(CLASS) public @interface AliasOf
Defines an alias between an existing Hilt scope and the annotated scope. For example, the following code makes @MyScope a functional replacement for @ActivityScope.

   @Scope
   @AliasOf(ActivityScope.class)
   public @interface MyScope{}
 

  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    Class<? extends Annotation>[]
    Returns the existing Hilt scope(s) that the annotated scope is aliasing.
  • Element Details

    • value

      Class<? extends Annotation>[] value
      Returns the existing Hilt scope(s) that the annotated scope is aliasing.