Module spring.data.redis
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) Deserializekeywith the streamSerializer, field names with the fieldSerializer and values with the valueSerializer.default <T> MapRecord<T,T, T> deserialize(RedisSerializer<T> serializer) static ByteBufferRecordof(MapRecord<ByteBuffer, ByteBuffer, ByteBuffer> source) Convert a binaryMapRecordinto aByteRecord.default <OV> ObjectRecord<ByteBuffer,OV> toObjectRecord(HashMapper<? super OV, ? super ByteBuffer, ? super ByteBuffer> mapper) Convert a binaryMapRecordinto anObjectRecord.withStreamKey(ByteBuffer key) Create a newByteBufferRecordwith the associated stream key.Methods inherited from interface java.lang.Iterable
forEach, iterator, spliteratorMethods inherited from interface org.springframework.data.redis.connection.stream.MapRecord
map, mapEntries, serialize, serialize, withStreamKeyMethods inherited from interface org.springframework.data.redis.connection.stream.Record
getId, getRequiredStream, getStream, getValue
-
Method Details
-
withId
Description copied from interface:Record- Specified by:
withIdin interfaceMapRecord<ByteBuffer,ByteBuffer, ByteBuffer> - Specified by:
withIdin interfaceRecord<ByteBuffer,Map<ByteBuffer, ByteBuffer>> - Parameters:
id- must not be null.- Returns:
- new instance of
Record.
-
withStreamKey
Create a newByteBufferRecordwith the associated stream key.- Parameters:
key- the binary stream key.- Returns:
- a new
ByteBufferRecord.
-
deserialize
Deserializekeyandfield/value pairswith the givenRedisSerializer. An already assignedidis 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) Deserializekeywith the streamSerializer, field names with the fieldSerializer and values with the valueSerializer. An already assignedidis 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
MapRecordholding the deserialized values.
-
of
Convert a binaryMapRecordinto 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 binaryMapRecordinto anObjectRecord.- Specified by:
toObjectRecordin interfaceMapRecord<ByteBuffer,ByteBuffer, ByteBuffer> - Type Parameters:
OV- type of the value backing theObjectRecord.- Parameters:
mapper- must not be null.- Returns:
- new instance of
ByteRecord.
-