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 RecordIdObtain theRecordIdsignalling the server to auto generate an entry-id on insert (XADD).booleanGet the entry-id sequenceNumber part or null if itshouldBeAutoGenerated().Get the entry-id millisecondsTime part or null if itshouldBeAutoGenerated().getValue()inthashCode()static RecordIdof(long millisecondsTime, long sequenceNumber) Create a new instance ofRecordIdusing the provided String formatted as <millisecondsTime>-<sequenceNumber>.static RecordIdObtain an instance ofRecordIdusing the provided String formatted as <millisecondsTime>-<sequenceNumber>.booleantoString()
-
Method Details
-
of
Obtain an instance ofRecordIdusing 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
RecordIdif no autogenerated one requested.
-
of
Create a new instance ofRecordIdusing 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 theRecordIdsignalling the server to auto generate an entry-id on insert (XADD).- Returns:
RecordIdinstance 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()
-