Class RedisStreamCommands.XAddOptions

java.lang.Object
org.springframework.data.redis.connection.RedisStreamCommands.XAddOptions
Enclosing interface:
RedisStreamCommands

public static class RedisStreamCommands.XAddOptions extends Object
Additional options applicable for XADD command.
Since:
2.3
Author:
Christoph Strobl, Mark John Moreno, Liming Deng
  • Method Details

    • none

      public static RedisStreamCommands.XAddOptions none()
      Returns:
    • makeNoStream

      public static RedisStreamCommands.XAddOptions makeNoStream()
      Disable creation of stream if it does not already exist.
      Returns:
      new instance of RedisStreamCommands.XAddOptions.
      Since:
      2.6
    • makeNoStream

      public static RedisStreamCommands.XAddOptions makeNoStream(boolean makeNoStream)
      Disable creation of stream if it does not already exist.
      Parameters:
      makeNoStream - true to not create a stream if it does not already exist.
      Returns:
      new instance of RedisStreamCommands.XAddOptions.
      Since:
      2.6
    • maxlen

      public static RedisStreamCommands.XAddOptions maxlen(long maxlen)
      Limit the size of the stream to the given maximum number of elements.
      Returns:
      new instance of RedisStreamCommands.XAddOptions.
    • minId

      Apply MINID trimming strategy, that evicts entries with IDs lower than the one specified.
      Parameters:
      minId - the minimum record Id to retain.
      Returns:
      new instance of RedisStreamCommands.XAddOptions.
      Since:
      2.7
    • approximateTrimming

      public RedisStreamCommands.XAddOptions approximateTrimming(boolean approximateTrimming)
      Apply efficient trimming for capped streams using the ~ flag.
      Returns:
      new instance of RedisStreamCommands.XAddOptions.
    • isNoMkStream

      public boolean isNoMkStream()
      Returns:
      true if NOMKSTREAM is set.
      Since:
      2.6
    • getMaxlen

      @Nullable public Long getMaxlen()
      Limit the size of the stream to the given maximum number of elements.
      Returns:
      can be null.
    • hasMaxlen

      public boolean hasMaxlen()
      Returns:
      true if MAXLEN is set.
    • isApproximateTrimming

      public boolean isApproximateTrimming()
      Returns:
      true if approximateTrimming is set.
    • getMinId

      @Nullable public RecordId getMinId()
      Returns:
      the minimum record Id to retain during trimming.
      Since:
      2.7
    • hasMinId

      public boolean hasMinId()
      Returns:
      true if MINID is set.
      Since:
      2.7
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object