Interface ByteRecord

All Superinterfaces:
Iterable<Map.Entry<byte[],byte[]>>, MapRecord<byte[],byte[],byte[]>, Record<byte[],Map<byte[],byte[]>>

public interface ByteRecord extends MapRecord<byte[],byte[],byte[]>
A Record within the stream backed by a collection of binary field/value pairs.
Author:
Christoph Strobl
  • Method Details

    • withId

      ByteRecord withId(RecordId id)
      Description copied from interface: Record
      Create a new instance of Record with the given RecordId.
      Specified by:
      withId in interface MapRecord<byte[],byte[],byte[]>
      Specified by:
      withId in interface Record<byte[],Map<byte[],byte[]>>
      Parameters:
      id - must not be null.
      Returns:
      new instance of Record.
    • withStreamKey

      ByteRecord withStreamKey(byte[] key)
      Create a new ByteRecord with the associated stream key.
      Parameters:
      key - the binary stream key.
      Returns:
      a new ByteRecord.
    • deserialize

      default <T> MapRecord<T,T,T> deserialize(@Nullable RedisSerializer<T> serializer)
      Deserialize key and field/value pairs with the given RedisSerializer. An already assigned id is carried over to the new instance.
      Parameters:
      serializer - can be null if the Record only holds binary data.
      Returns:
      new MapRecord holding the deserialized values.
    • deserialize

      default <K, HK, HV> MapRecord<K,HK,HV> deserialize(@Nullable RedisSerializer<? extends K> streamSerializer, @Nullable RedisSerializer<? extends HK> fieldSerializer, @Nullable RedisSerializer<? extends HV> valueSerializer)
      Deserialize key with the streamSerializer, field names with the fieldSerializer and values with the valueSerializer. An already assigned id 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

      static ByteRecord of(MapRecord<byte[],byte[],byte[]> source)
      Convert a binary MapRecord into a ByteRecord.
      Parameters:
      source - must not be null.
      Returns:
      new instance of ByteRecord.