Class RedisStreamCommands.XAddOptions
java.lang.Object
org.springframework.data.redis.connection.RedisStreamCommands.XAddOptions
- Enclosing interface:
- RedisStreamCommands
Additional options applicable for XADD command.
- Since:
- 2.3
- Author:
- Christoph Strobl, Mark John Moreno, Liming Deng
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionapproximateTrimming(boolean approximateTrimming) Deprecated.boolean@Nullable LongLimit the size of the stream to the given maximum number of elements.@Nullable RecordIdgetMinId()@Nullable RedisStreamCommands.TrimOptionsinthashCode()booleanbooleanhasMinId()booleanbooleanbooleanDisable creation of stream if it does not already exist.makeNoStream(boolean makeNoStream) Whether to disable creation of stream if it does not already exist.maxlen(long maxlen) Limit the size of the stream to the given maximum number of elements.ApplyMINIDtrimming strategy, that evicts entries with IDs lower than the one specified.nomkstream(boolean nomkstream) none()Create default add options.trim(@Nullable RedisStreamCommands.TrimOptions trimOptions)
-
Field Details
-
NONE
-
-
Method Details
-
none
Create default add options.- Returns:
- new instance of
RedisStreamCommands.XAddOptionswith default values - Since:
- 2.6
-
trim
public static RedisStreamCommands.XAddOptions trim(@Nullable RedisStreamCommands.TrimOptions trimOptions) -
makeNoStream
Disable creation of stream if it does not already exist.- Returns:
- new instance of
RedisStreamCommands.XAddOptions. - Since:
- 2.6
-
makeNoStream
Whether to disable creation of stream if it does not already exist.- Parameters:
makeNoStream-trueto not create a stream if it does not already exist.- Returns:
- new instance of
RedisStreamCommands.XAddOptions. - Since:
- 2.6
-
maxlen
Limit the size of the stream to the given maximum number of elements.- Returns:
- new instance of
RedisStreamCommands.XAddOptions.
-
minId
ApplyMINIDtrimming 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
@Deprecated(since="4.0", forRemoval=false) public RedisStreamCommands.XAddOptions approximateTrimming(boolean approximateTrimming) Deprecated.since 4.0: callers must specify a concrete trim strategy (MAXLEN or MINID) viaRedisStreamCommands.TrimOptions; do not use this method to only toggle approximate/exact. PreferXAddOptions.trim(TrimOptions.maxLen(n).approximate())orXAddOptions.trim(TrimOptions.minId(id).exact()).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
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
- 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
-
nomkstream
-
hasTrimOptions
public boolean hasTrimOptions() -
getTrimOptions
-
equals
-
hashCode
public int hashCode()
-
RedisStreamCommands.TrimOptions; do not use this method to only toggle approximate/exact.