Interface ByteBufferRecord
- All Superinterfaces:
Iterable<Map.Entry<ByteBuffer,
,ByteBuffer>> MapRecord<ByteBuffer,
,ByteBuffer, ByteBuffer> Record<ByteBuffer,
Map<ByteBuffer, ByteBuffer>>
A
Record
within the stream backed by a collection of binary field/value pairs.- Author:
- Christoph Strobl
-
Method Summary
Modifier and TypeMethodDescriptiondefault <K,
HK, HV> MapRecord<K, HK, HV> deserialize
(RedisSerializer<? extends K> streamSerializer, RedisSerializer<? extends HK> fieldSerializer, RedisSerializer<? extends HV> valueSerializer) Deserializekey
with the streamSerializer, field names with the fieldSerializer and values with the valueSerializer.default <T> MapRecord<T,
T, T> deserialize
(RedisSerializer<T> serializer) static ByteBufferRecord
of
(MapRecord<ByteBuffer, ByteBuffer, ByteBuffer> source) Convert a binaryMapRecord
into aByteRecord
.default <OV> ObjectRecord<ByteBuffer,
OV> toObjectRecord
(HashMapper<? super OV, ? super ByteBuffer, ? super ByteBuffer> mapper) Convert a binaryMapRecord
into anObjectRecord
.withStreamKey
(ByteBuffer key) Create a newByteBufferRecord
with the associated stream key.Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
Methods inherited from interface org.springframework.data.redis.connection.stream.MapRecord
map, mapEntries, serialize, serialize, withStreamKey
Methods inherited from interface org.springframework.data.redis.connection.stream.Record
getId, getRequiredStream, getStream, getValue
-
Method Details
-
withId
Description copied from interface:Record
- Specified by:
withId
in interfaceMapRecord<ByteBuffer,
ByteBuffer, ByteBuffer> - Specified by:
withId
in interfaceRecord<ByteBuffer,
Map<ByteBuffer, ByteBuffer>> - Parameters:
id
- must not be null.- Returns:
- new instance of
Record
.
-
withStreamKey
Create a newByteBufferRecord
with the associated stream key.- Parameters:
key
- the binary stream key.- Returns:
- a new
ByteBufferRecord
.
-
deserialize
Deserializekey
andfield/value pairs
with the givenRedisSerializer
. An already assignedid
is carried over to the new instance. -
deserialize
default <K,HK, MapRecord<K,HV> HK, deserializeHV> (@Nullable RedisSerializer<? extends K> streamSerializer, @Nullable RedisSerializer<? extends HK> fieldSerializer, @Nullable RedisSerializer<? extends HV> valueSerializer) Deserializekey
with the streamSerializer, field names with the fieldSerializer and values with the valueSerializer. An already assignedid
is carried over to the new instance.- Parameters:
streamSerializer
- can be null if the key suites already the target format.fieldSerializer
- can be null if the fields suite already the target format.valueSerializer
- can be null if the values suite already the target format.- Returns:
- new
MapRecord
holding the deserialized values.
-
of
Convert a binaryMapRecord
into aByteRecord
.- Parameters:
source
- must not be null.- Returns:
- new instance of
ByteRecord
.
-
toObjectRecord
default <OV> ObjectRecord<ByteBuffer,OV> toObjectRecord(HashMapper<? super OV, ? super ByteBuffer, ? super ByteBuffer> mapper) Convert a binaryMapRecord
into anObjectRecord
.- Specified by:
toObjectRecord
in interfaceMapRecord<ByteBuffer,
ByteBuffer, ByteBuffer> - Type Parameters:
OV
- type of the value backing theObjectRecord
.- Parameters:
mapper
- must not be null.- Returns:
- new instance of
ByteRecord
.
-