Class IntervalStreamId

  • All Implemented Interfaces:
    java.io.Serializable, StreamId<java.lang.Long>

    public class IntervalStreamId
    extends java.lang.Object
    implements StreamId<java.lang.Long>
    A stream id, which emits values periodically.
    See Also:
    Serialized Form
    • Method Detail

      • every

        public static final IntervalStreamId every​(long period,
                                                   java.util.concurrent.TimeUnit timeUnit)
        Creates stream id that emits sequentially increasing number with specified interval. First value is emitted immediately.
        Parameters:
        period - Specifies how often values should be emitted.
        timeUnit - Time unit for period.
        Returns:
        IntervalStreamId
      • delayedBy

        public final IntervalStreamId delayedBy​(long newInitialDelay,
                                                java.util.concurrent.TimeUnit timeUnit)
        Creates stream id with the same period as the current one, but delayed by specific time.
        Parameters:
        newInitialDelay - Time by which to delay the stream
        timeUnit - Time unit for newInitialDelay
        Returns:
        IntervalStreamId
      • getPeriodTimeUnit

        public java.util.concurrent.TimeUnit getPeriodTimeUnit()
      • getInitialDelay

        public long getInitialDelay()
      • getPeriod

        public long getPeriod()
      • getInitialDelayTimeUnit

        public java.util.concurrent.TimeUnit getInitialDelayTimeUnit()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object