Class XAddArgs
- java.lang.Object
-
- io.quarkus.redis.datasource.stream.XAddArgs
-
- All Implemented Interfaces:
RedisCommandExtraArguments
public class XAddArgs extends Object implements RedisCommandExtraArguments
The argument of the XADD command.
-
-
Constructor Summary
Constructors Constructor Description XAddArgs()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description XAddArgs
id(String id)
Sets the stream id to identify a given entry inside a stream.XAddArgs
limit(long limit)
Sets the maximum entries that can get evicted.XAddArgs
maxlen(Long maxlen)
Sets the max length of the stream.XAddArgs
minid(String minid)
Evicts entries from the stream having IDs lower to the specified one.XAddArgs
nearlyExactTrimming()
When set, prefix themaxlen
with~
to enable the almost exact trimming.XAddArgs
nomkstream()
Do not create a new stream if the stream does not exist yet.List<String>
toArgs()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.quarkus.redis.datasource.RedisCommandExtraArguments
toArgs
-
-
-
-
Method Detail
-
id
public XAddArgs id(String id)
Sets the stream id to identify a given entry inside a stream. If not set, the stream id is generated by the Redis server.- Parameters:
id
- the id, must not benull
, but be formed by two numbers separated by a-
. In general, the first number is a timestamp.- Returns:
- the current
XAddArgs
-
maxlen
public XAddArgs maxlen(Long maxlen)
Sets the max length of the stream. WhenXADD
is called with this parameter, the new entry is added to the stream, but if the max size is reached, the oldest entry is evicted.- Parameters:
maxlen
- the max length of the stream, must be positive- Returns:
- the current
XAddArgs
-
nearlyExactTrimming
public XAddArgs nearlyExactTrimming()
When set, prefix themaxlen
with~
to enable the almost exact trimming. This is recommended when usingmaxlen(Long)
.- Returns:
- the current
XAddArgs
-
nomkstream
public XAddArgs nomkstream()
Do not create a new stream if the stream does not exist yet.- Returns:
- the current
XAddArgs
-
minid
public XAddArgs minid(String minid)
Evicts entries from the stream having IDs lower to the specified one.- Parameters:
minid
- the min id, must not benull
, must be a valid stream id- Returns:
- the current
XAddArgs
-
limit
public XAddArgs limit(long limit)
Sets the maximum entries that can get evicted.- Parameters:
limit
- the limit, must be positive- Returns:
- the current
XAddArgs
-
toArgs
public List<String> toArgs()
- Specified by:
toArgs
in interfaceRedisCommandExtraArguments
- Returns:
- the list of arguments, encoded as a list of String.
-
-