Interface ObjectRecord<S,V>

Type Parameters:
V - the type of the backing Object.
All Superinterfaces:
Record<S,V>

public interface ObjectRecord<S,V> extends Record<S,V>
A Record within the stream mapped to a single object. This may be a simple type, such as String or a complex one.
Author:
Christoph Strobl, Mark Paluch
  • Method Details

    • create

      static <S, V> ObjectRecord<S,V> create(S stream, V value)
      Creates a new ObjectRecord associated with the stream key and value.
      Parameters:
      stream - the stream key.
      value - the value.
      Returns:
      the ObjectRecord holding the stream key and value.
    • withId

      ObjectRecord<S,V> withId(RecordId id)
      Description copied from interface: Record
      Create a new instance of Record with the given RecordId.
      Specified by:
      withId in interface Record<S,V>
      Parameters:
      id - must not be null.
      Returns:
      new instance of Record.
    • withStreamKey

      <SK> ObjectRecord<SK,V> withStreamKey(SK key)
      Description copied from interface: Record
      Create a new instance of Record with the given key to store the record at.
      Specified by:
      withStreamKey in interface Record<S,V>
      Parameters:
      key - the Redis key identifying the stream.
      Returns:
      new instance of Record.
    • toMapRecord

      default <HK, HV> MapRecord<S,HK,HV> toMapRecord(HashMapper<? super V,HK,HV> mapper)
      Apply the given HashMapper to the backing value to create a new MapRecord. An already assigned id is carried over to the new instance.
      Type Parameters:
      HK - the key type of the resulting MapRecord.
      HV - the value type of the resulting MapRecord.
      Parameters:
      mapper - must not be null.
      Returns:
      new instance of MapRecord.