Package io.lettuce.core
Class XAddArgs
- java.lang.Object
-
- io.lettuce.core.XAddArgs
-
- All Implemented Interfaces:
CompositeArgument
public class XAddArgs extends Object implements CompositeArgument
Argument list builder for the Redis XADD command. Static import the methods fromXAddArgs.Builder
and call the methods:maxlen(…)
.XAddArgs
is a mutable object and instances should be used only once to avoid shared mutable state.- Since:
- 5.1
- Author:
- Mark Paluch, dengliming
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
XAddArgs.Builder
Builder entry points forXAddArgs
.
-
Constructor Summary
Constructors Constructor Description XAddArgs()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description XAddArgs
approximateTrimming()
Apply efficient trimming for capped streams using the~
flag.XAddArgs
approximateTrimming(boolean approximateTrimming)
Apply efficient trimming for capped streams using the~
flag.<K,V>
voidbuild(CommandArgs<K,V> args)
Build command arguments and contribute arguments toCommandArgs
.XAddArgs
exactTrimming()
Apply exact trimming for capped streams using the=
flag.XAddArgs
exactTrimming(boolean exactTrimming)
Apply exact trimming for capped streams using the=
flag.XAddArgs
id(String id)
Specify the messageid
.XAddArgs
limit(long limit)
The maximum number of entries to trim.XAddArgs
maxlen(long maxlen)
Limit stream tomaxlen
entries.XAddArgs
minId(String minid)
Limit stream entries by message Id.XAddArgs
nomkstream()
Do add the message if the stream does not already exist.XAddArgs
nomkstream(boolean nomkstream)
Do add the message if the stream does not already exist.
-
-
-
Method Detail
-
id
public XAddArgs id(String id)
Specify the messageid
.- Parameters:
id
- must not benull
.- Returns:
this
-
maxlen
public XAddArgs maxlen(long maxlen)
Limit stream tomaxlen
entries.- Parameters:
maxlen
- number greater 0.- Returns:
this
-
minId
public XAddArgs minId(String minid)
Limit stream entries by message Id.- Parameters:
minid
- the oldest ID in the stream will be exactly the minimum between its original oldest ID and the specified threshold.- Returns:
this
- Since:
- 6.1
-
limit
public XAddArgs limit(long limit)
The maximum number of entries to trim.- Parameters:
limit
- has meaning only if`~`
was set.- Returns:
this
- Since:
- 6.1
-
approximateTrimming
public XAddArgs approximateTrimming()
Apply efficient trimming for capped streams using the~
flag.- Returns:
this
-
approximateTrimming
public XAddArgs approximateTrimming(boolean approximateTrimming)
Apply efficient trimming for capped streams using the~
flag.- Parameters:
approximateTrimming
-true
to apply efficient radix node trimming.- Returns:
this
-
exactTrimming
public XAddArgs exactTrimming()
Apply exact trimming for capped streams using the=
flag.- Returns:
this
- Since:
- 6.1
-
exactTrimming
public XAddArgs exactTrimming(boolean exactTrimming)
Apply exact trimming for capped streams using the=
flag.- Parameters:
exactTrimming
-true
to apply exact radix node trimming.- Returns:
this
- Since:
- 6.1
-
nomkstream
public XAddArgs nomkstream()
Do add the message if the stream does not already exist.- Returns:
this
- Since:
- 6.1
-
nomkstream
public XAddArgs nomkstream(boolean nomkstream)
Do add the message if the stream does not already exist.- Parameters:
nomkstream
-true
to not create a stream if it does not already exist.- Returns:
this
- Since:
- 6.1
-
build
public <K,V> void build(CommandArgs<K,V> args)
Description copied from interface:CompositeArgument
Build command arguments and contribute arguments toCommandArgs
.Implementing classes are required to implement this method. Depending on the command nature and configured arguments, this method may contribute arguments but is not required to add arguments if none are specified.
- Specified by:
build
in interfaceCompositeArgument
- Type Parameters:
K
- Key type.V
- Value type.- Parameters:
args
- the command arguments, must not benull
.
-
-