Interface Record<S,V>
- Type Parameters:
V- the type backing theRecord.
- All Known Subinterfaces:
ByteBufferRecord,ByteRecord,MapRecord<S,,K, V> ObjectRecord<S,,V> StringRecord
public interface Record<S,V>
A single entry in the stream consisting of the
entry-id and the actual entry-value (typically a
collection of field/value pairs).- Since:
- 2.2
- Author:
- Christoph Strobl
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiongetId()The id of the entry inside the stream.default SThe id of the stream (aka the key in Redis).The id of the stream (aka the key in Redis).getValue()static <S,K, V> MapRecord<S, K, V> static <S,V> ObjectRecord<S, V> of(V value) Create a newObjectRecordinstance backed by the given value.withStreamKey(SK key) Create a new instance ofRecordwith the given key to store the record at.
-
Method Details
-
getStream
The id of the stream (aka the key in Redis).- Returns:
- can be null.
-
getRequiredStream
The id of the stream (aka the key in Redis).- Returns:
- can be null.
- Throws:
IllegalStateException- if the stream is null.- Since:
- 3.0
-
getId
RecordId getId()The id of the entry inside the stream.- Returns:
- never null.
-
getValue
V getValue()- Returns:
- the actual content. Never null.
-
of
Create a newMapRecordinstance backed by the givenMapholding field/value pairs.
You may want to use the builders available viaStreamRecords. -
of
Create a newObjectRecordinstance backed by the given value. The value may be a simple type, likeStringor a complex one.
You may want to use the builders available viaStreamRecords.- Type Parameters:
V- the type of the backing value.- Parameters:
value- the value to persist.- Returns:
- new instance of
MapRecord.
-
withId
- Parameters:
id- must not be null.- Returns:
- new instance of
Record.
-
withStreamKey
Create a new instance ofRecordwith the given key to store the record at.- Type Parameters:
SK-- Parameters:
key- the Redis key identifying the stream.- Returns:
- new instance of
Record.
-