Class IntervalStreamId
- java.lang.Object
-
- org.streamingpool.core.service.streamid.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 Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description IntervalStreamIddelayedBy(long newInitialDelay, java.util.concurrent.TimeUnit timeUnit)Creates stream id with the same period as the current one, but delayed by specific time.booleanequals(java.lang.Object obj)static IntervalStreamIdevery(long period, java.util.concurrent.TimeUnit timeUnit)Creates stream id that emits sequentially increasing number with specified interval.longgetInitialDelay()java.util.concurrent.TimeUnitgetInitialDelayTimeUnit()longgetPeriod()java.util.concurrent.TimeUnitgetPeriodTimeUnit()inthashCode()java.lang.StringtoString()
-
-
-
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 streamtimeUnit- 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:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-