Class RedisStreamCommands.TrimOptions
java.lang.Object
org.springframework.data.redis.connection.RedisStreamCommands.TrimOptions
- Enclosing interface:
- RedisStreamCommands
-
Method Summary
Modifier and TypeMethodDescriptionUse approximate trimming ("~").deletionPolicy(RedisStreamCommands.StreamDeletionPolicy deletionPolicy) Set the deletion policy for trimming.booleanexact()Use exact trimming ("=").@Nullable RedisStreamCommands.StreamDeletionPolicy@Nullable LonggetLimit()booleaninthashCode()booleanhasLimit()limit(long limit) Limit the maximum number of entries considered when trimming.maxLen(long maxLen) Create trim options using the MAXLEN strategy with the given threshold.Create trim options using the MINID strategy with the given minimum id.trim(RedisStreamCommands.TrimOperator trimOperator) Apply specified trim operator.
-
Method Details
-
maxLen
Create trim options using the MAXLEN strategy with the given threshold.Produces
RedisStreamCommands.TrimOptionswith the exact ("=") operator by default; callapproximate()to use approximate ("~") trimming.- Parameters:
maxLen- maximum number of entries to retain in the stream- Returns:
- new
RedisStreamCommands.TrimOptionsconfigured with the MAXLEN strategy - Since:
- 4.0
-
minId
Create trim options using the MINID strategy with the given minimum id.Produces
RedisStreamCommands.TrimOptionswith the exact ("=") operator by default; callapproximate()to use approximate ("~") trimming.- Parameters:
minId- minimum id; entries with an id lower than this value are eligible for trimming- Returns:
- new
RedisStreamCommands.TrimOptionsconfigured with the MINID strategy - Since:
- 4.0
-
trim
Apply specified trim operator.This is a member method that preserves all other options.
- Parameters:
trimOperator- the operator to use when trimming- Returns:
- new instance of
RedisStreamCommands.XTrimOptions.
-
approximate
Use approximate trimming ("~").This is a member method that preserves all other options.
- Returns:
- new instance of
RedisStreamCommands.TrimOptionswithRedisStreamCommands.TrimOperator.APPROXIMATE.
-
exact
Use exact trimming ("=").This is a member method that preserves all other options.
- Returns:
- new instance of
RedisStreamCommands.TrimOptionswithRedisStreamCommands.TrimOperator.EXACT.
-
limit
Limit the maximum number of entries considered when trimming.This is a member method that preserves all other options.
- Parameters:
limit- the maximum number of entries to examine for trimming.- Returns:
- new instance of
RedisStreamCommands.XTrimOptions.
-
deletionPolicy
public RedisStreamCommands.TrimOptions deletionPolicy(RedisStreamCommands.StreamDeletionPolicy deletionPolicy) Set the deletion policy for trimming.This is a member method that preserves all other options.
- Parameters:
deletionPolicy- the deletion policy to apply.- Returns:
- new instance of
RedisStreamCommands.XTrimOptions.
-
getTrimStrategy
-
getTrimOperator
- Returns:
- strategy to use when trimming entries
-
getLimit
- Returns:
- the limit to retain during trimming.
- Since:
- 4.0
-
hasLimit
public boolean hasLimit()- Returns:
- true if LIMIT is set.
- Since:
- 4.0
-
getDeletionPolicy
- Returns:
- the deletion policy.
- Since:
- 4.0
-
hasDeletionPolicy
public boolean hasDeletionPolicy()- Returns:
- true if DELETION_POLICY is set.
- Since:
- 4.0
-
equals
-
hashCode
public int hashCode()
-