Annotation Type Getter


  • @Target(PARAMETER)
    @Retention(RUNTIME)
    public @interface Getter
    Annotates a parameter in an event listener whose value should be fetched from a getter on the event type with the specified name.

    For example if the event type has a method 'T getObject();' then you would annotate a parameter of type T with '@Getter("getObject")'.

    For optional types the value of the parameter can be either Optional or the type of the enclosed object. If the type is the enclosed type then the optional will be automatically unwrapped and if the optional is not present then your event listener will not be called.

    • Required Element Summary

      Required Elements 
      Modifier and Type Required Element Description
      java.lang.String value
      The name of the method to fetch the value from within the event type.
    • Element Detail

      • value

        java.lang.String value
        The name of the method to fetch the value from within the event type.
        Returns:
        The method name