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 boolean
equals(Object o)
static OffsetSpecification
first()
The first available offset in the stream.long
getOffset()
short
getType()
int
hashCode()
boolean
isOffset()
boolean
isTimestamp()
static OffsetSpecification
last()
The last chunk of messages in the stream.static OffsetSpecification
next()
The next offset to be written, that is the end of the stream.static OffsetSpecification
none()
When the offset specification is not relevant.static OffsetSpecification
offset(long offset)
A specific offset in the stream.static OffsetSpecification
timestamp(long timestamp)
Offset of messages stored after the specified timestamp.String
toString()
-
-
-
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()
-
-