Annotation Interface Subscribe


@Retention(RUNTIME) @Target(METHOD) public @interface Subscribe
Since:
0.8
Author:
Haiyang Li
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
    Ignore next event if it's same as previous one.
    Only subscribe the events which are posted with the specified event id.
    long
    The event will be ignored if the interval between this event and last event is less than the specified interval.
    boolean
    If true, delivers the most recent sticky event (posted with EventBus.postSticky(Object)) to this subscriber (if event available).
    boolean
    Only accept the events which have extract same class type as the method parameter if it's true.
     
  • Element Details

    • threadMode

      ThreadMode threadMode
      Returns:
      Default:
      DEFAULT
    • strictEventType

      boolean strictEventType
      Only accept the events which have extract same class type as the method parameter if it's true. Otherwise, accept all the events which can be assigned to the parameter type. The precondition for both true and false is the event id has to match.
      Returns:
      true, if successful
      Default:
      false
    • sticky

      boolean sticky
      If true, delivers the most recent sticky event (posted with EventBus.postSticky(Object)) to this subscriber (if event available).
      Returns:
      true, if successful
      Default:
      false
    • eventId

      String eventId
      Only subscribe the events which are posted with the specified event id.
      Returns:
      Default:
      ""
    • interval

      long interval
      The event will be ignored if the interval between this event and last event is less than the specified interval.
      Returns:
      unit is milliseconds.
      Default:
      0L
    • deduplicate

      boolean deduplicate
      Ignore next event if it's same as previous one.
      Returns:
      true, if successful
      Default:
      false