Annotation Type ClassName


@Target({TYPE_USE,PARAMETER}) @Retention(RUNTIME) public @interface ClassName
Parameters, function return with types that can't be resolved at compile time may be annotated with @ClassName.

Use this annotation when creating shadow methods that contain new Android types in the method signature, return type that do not exist in older SDK levels.

@Implements(FooAndroidClass.class)
class ShadowFooAndroidClass {

   // A method shadowing FooAndroidClass#setBar(com.android.RealClassName, int, String)
   // Generally, @ClassName will be used together with Object type.
   @Implementation
   public @ClassName("com.android.RealReturnType") Object setBar(
       @ClassName("com.android.RealClassName") Object para1,
       int para2,
       String para3) {

   }
}
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    @NonNull String
    The class name intended for the parameter or the function return value.
  • Element Details