Interface SegmentPublisherSupplier.Notification<R>

Type Parameters:
R - the value type if present
All Known Subinterfaces:
SegmentAwarePublisherSupplier.NotificationWithLost<R>
Enclosing interface:
SegmentPublisherSupplier<R>

public static interface SegmentPublisherSupplier.Notification<R>
Wrapper around an element returned that can either be a value or a segment completion. Note that the user should invoke isSegmentComplete() or isValue() to determine which type it is.
  • Method Summary

    Modifier and Type
    Method
    Description
    default int
    The segment that was complete for this notification
    boolean
    Whether this notification is for a completed segmented
    boolean
    Whether this notification contains a value, always non null if so
    default R
    The value when present for this notification
    default int
    The segment that maps for the value of this notification
  • Method Details

    • isValue

      boolean isValue()
      Whether this notification contains a value, always non null if so
      Returns:
      true if a value is present
    • isSegmentComplete

      boolean isSegmentComplete()
      Whether this notification is for a completed segmented
      Returns:
      true if a segment is complete
    • value

      default R value()
      The value when present for this notification
      Returns:
      the value
      Throws:
      IllegalStateException - if this notification is segment complete
    • valueSegment

      default int valueSegment()
      The segment that maps for the value of this notification
      Returns:
      the segment
      Throws:
      IllegalStateException - if this notification is segment complete
    • completedSegment

      default int completedSegment()
      The segment that was complete for this notification
      Returns:
      the segment
      Throws:
      IllegalStateException - if this notification contains a value