Package com.rabbitmq.stream
Class OffsetSpecification
- java.lang.Object
-
- com.rabbitmq.stream.OffsetSpecification
-
public class OffsetSpecification extends Object
API to specify an offset in a stream.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)static OffsetSpecificationfirst()The first available offset in the stream.longgetOffset()shortgetType()inthashCode()booleanisOffset()booleanisTimestamp()static OffsetSpecificationlast()The last chunk of messages in the stream.static OffsetSpecificationnext()The next offset to be written, that is the end of the stream.static OffsetSpecificationnone()When the offset specification is not relevant.static OffsetSpecificationoffset(long offset)A specific offset in the stream.static OffsetSpecificationtimestamp(long timestamp)Offset of messages stored after the specified timestamp.StringtoString()
-
-
-
Method Detail
-
none
public static OffsetSpecification none()
When the offset specification is not relevant.- Returns:
- none offset specification
-
first
public static OffsetSpecification first()
The first available offset in the stream.If the stream has not been truncated, this means the beginning of the stream (offset 0).
- Returns:
- first offset in a stream
-
last
public static OffsetSpecification last()
The last chunk of messages in the stream.- Returns:
- the offset of the last chunk of messages
-
next
public static OffsetSpecification next()
The next offset to be written, that is the end of the stream.- Returns:
- The next offset to be written
-
offset
public static OffsetSpecification offset(long offset)
A specific offset in the stream.The first offset of a non-truncated stream is 0.
- Parameters:
offset-- Returns:
- the absolute offset
-
timestamp
public static OffsetSpecification timestamp(long timestamp)
Offset of messages stored after the specified timestamp.Be aware consumers can receive messages published a bit before the specified timestamp.
- Parameters:
timestamp-- Returns:
- messages stored after the specified timestamp
-
isOffset
public boolean isOffset()
-
isTimestamp
public boolean isTimestamp()
-
getType
public short getType()
-
getOffset
public long getOffset()
-
-