Annotation Interface ThisIs


@Documented @Retention(RUNTIME) @Target(METHOD) public @interface ThisIs
Annotation that typing generation mods can use to declare type guards.

Use this on boolean-returning methods that can guarantee that if the method returns true, the current instance may be treated as the provided class type.

Type guards can help narrow down types in conditional blocks.

  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Class<?>[]
     
    (Fully qualified) class names of types this object may be assigned to.
    Class<?>[]
    Alias for classes()
  • Element Details

    • value

      Class<?>[] value
      Alias for classes()
      See Also:
      Default:
      {}
    • classes

      Class<?>[] classes
      Default:
      {}
    • classNames

      String[] classNames
      (Fully qualified) class names of types this object may be assigned to.

      This **needs** to be used with client-only classes to avoid loading them, otherwise the annotation scanner will crash the game!

      Default:
      {}