Annotation Type Type


@DefaultQualifier(org.checkerframework.checker.nullness.qual.NonNull.class) @Target(PARAMETER) @Retention(RUNTIME) public @interface Type
Used to specify an alternate type to use instead of the annotated element's type.

This is mostly useful when a method has a parameter whose type is not visible during compilation, as it allows referencing a reflection proxy, or fully qualified class name to use instead of Object, which must be used at compile time for these types.

  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    The fully qualified name of the target class.
    A reflection proxy interface proxying the target class.
  • Element Details

    • value

      Class<?> value
      A reflection proxy interface proxying the target class. A value of Object.class indicates it has not been changed from the default, and that className() should be used to lookup the class instead.
      Returns:
      target class
      Default:
      java.lang.Object.class
    • className

      String className
      The fully qualified name of the target class. A value of "" (empty string) indicates it has not been changed from the default, and that value() should be used instead.
      Returns:
      target class name
      Default:
      ""