Class RecordId
java.lang.Object
org.springframework.data.redis.connection.stream.RecordId
The id of a single
Record
within a stream. Composed of two parts:
<millisecondsTime>-<sequenceNumber>.- Since:
- 2.2
- Author:
- Christoph Strobl
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic RecordId
Obtain theRecordId
signalling the server to auto generate an entry-id on insert (XADD
).boolean
Get the entry-id sequenceNumber part or null if itshouldBeAutoGenerated()
.Get the entry-id millisecondsTime part or null if itshouldBeAutoGenerated()
.getValue()
int
hashCode()
static RecordId
of
(long millisecondsTime, long sequenceNumber) Create a new instance ofRecordId
using the provided String formatted as <millisecondsTime>-<sequenceNumber>.static RecordId
Obtain an instance ofRecordId
using the provided String formatted as <millisecondsTime>-<sequenceNumber>.boolean
toString()
-
Method Details
-
of
Obtain an instance ofRecordId
using the provided String formatted as <millisecondsTime>-<sequenceNumber>.
For server auto generated entry-id on insert pass in null or *. Event better, just useautoGenerate()
.- Parameters:
value
- can be null.- Returns:
- new instance of
RecordId
if no autogenerated one requested.
-
of
Create a new instance ofRecordId
using the provided String formatted as <millisecondsTime>-<sequenceNumber>.
For server auto generated entry-id on insert useautoGenerate()
.- Parameters:
millisecondsTime
-sequenceNumber
-- Returns:
- new instance of
RecordId
.
-
autoGenerate
Obtain theRecordId
signalling the server to auto generate an entry-id on insert (XADD
).- Returns:
RecordId
instance signallingshouldBeAutoGenerated()
.
-
getTimestamp
Get the entry-id millisecondsTime part or null if itshouldBeAutoGenerated()
.- Returns:
- millisecondsTime of the entry-id. Can be null.
-
getSequence
Get the entry-id sequenceNumber part or null if itshouldBeAutoGenerated()
.- Returns:
- sequenceNumber of the entry-id. Can be null.
-
shouldBeAutoGenerated
public boolean shouldBeAutoGenerated()- Returns:
- true if a new entry-id shall be generated on server side when calling
XADD
.
-
getValue
- Returns:
- get the string representation of the entry-id in <millisecondsTime>-<sequenceNumber>
format or * if it
shouldBeAutoGenerated()
. Never null.
-
toString
-
equals
-
hashCode
public int hashCode()
-