java.lang.Object
org.springframework.data.redis.connection.stream.ReadOffset

public final class ReadOffset extends Object
Value object representing read offset for a Stream.
  • Method Details

    • latest

      public static ReadOffset latest()
      Read from the latest offset.
      Returns:
    • lastConsumed

      public static ReadOffset lastConsumed()
      Read all new arriving elements with ids greater than the last one consumed by the consumer group.
      Returns:
      the ReadOffset object without a specific offset.
    • from

      public static ReadOffset from(String offset)
      Read all arriving elements from the stream starting at offset.
      Parameters:
      offset - the stream offset.
      Returns:
      the ReadOffset starting at offset.
    • from

      public static ReadOffset from(RecordId offset)
      Read all arriving elements from the stream starting at RecordId. Using a auto-generated RecordId returns the latest() read offset.
      Parameters:
      offset - the stream offset.
      Returns:
      the ReadOffset starting at RecordId.
    • getOffset

      public String getOffset()
    • equals

      public boolean equals(@Nullable Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object