Interface StreamEvent<T>

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      T getItem()
      The data, if this event represents an emission of data.
      long getRequestAmount()
      The request amount, if this event represents a request.
      int getSubscriptionId()
      The opaque id of the subscription that this event relates to.
      Throwable getThrowable()
      The error, if this event represents an error.
      boolean isCancel()
      Whether or not this event represents cancellation of the stream.
      boolean isComplete()
      Whether or not this event represents the completion of the stream.
      boolean isData()
      Whether or not this event represents an emission of data.
      boolean isError()
      Whether or not this event represents an error.
      boolean isRequest()
      Whether or not this event represents a request for more data.
    • Method Detail

      • getSubscriptionId

        int getSubscriptionId()
        The opaque id of the subscription that this event relates to.

        Events are emitted for each subscription to a publisher. This value can be used for differentiating events from different subscriptions.

        The ids are only unique for a context. That is, they are not globally unique. More precise semantics of ids should be specified by methods that emit events.

        Returns:
        an opaque id of the subscription this event belongs to
      • isComplete

        boolean isComplete()
        Whether or not this event represents the completion of the stream.
        Returns:
        whether or not this event represents the completion of the stream
      • isError

        boolean isError()
        Whether or not this event represents an error.

        If this method returns true, getThrowable() will return the corresponding exception. If this method returns false, getThrowable() will return null.

        Returns:
        whether or not this event represents an error
      • isData

        boolean isData()
        Whether or not this event represents an emission of data.

        If this method returns true, getItem() will return the corresponding data. If this method returns false, getItem() will return null.

        Returns:
        whether or not this event represents an error
      • isCancel

        boolean isCancel()
        Whether or not this event represents cancellation of the stream.
        Returns:
        whether or not this event represents cancellation of the stream
      • isRequest

        boolean isRequest()
        Whether or not this event represents a request for more data.

        If this method returns true, getRequestAmount() will return the amount requested. If this method returns false, getRequestAmount() will return 0.

        Returns:
        whether or not this event represents an error
      • getRequestAmount

        long getRequestAmount()
        The request amount, if this event represents a request.

        If isRequest() returns true, this method will return the corresponding request amount. If isRequest() returns false, this method will return 0.

        Returns:
        the request amount if this event represents a request, else 0
      • getThrowable

        @Nullable
        Throwable getThrowable()
        The error, if this event represents an error.

        If isError() returns true, this method will return the corresponding exception. If isError() returns false, this method will return null.

        Returns:
        the error if this event represents an error, else null
      • getItem

        @Nullable
        T getItem()
        The data, if this event represents an emission of data.

        If isData() returns true, this method will return the corresponding data item. If isData() returns false, this method will return null.

        Returns:
        the data if this event represents data, else null