public class IncrexArgs extends Object
INCREX command. Accepts long lower/upper
bounds; paired with the increx(K, long, IncrexArgs) overload on the commands interface (sends BYINT on the
wire).
For float-bounded INCREX use IncrexFloatArgs.
Usage:
IncrexArgs.Builder.ubound(100).saturate().ex(60) IncrexArgs.Builder.lbound(0).ubound(100).saturate() new IncrexArgs().ex(30).enx()
| Modifier and Type | Class and Description |
|---|---|
static class |
IncrexArgs.Builder |
| Constructor and Description |
|---|
IncrexArgs() |
| Modifier and Type | Method and Description |
|---|---|
<K,V> void |
build(CommandArgs<K,V> args)
Build command arguments and contribute arguments to
CommandArgs. |
protected <K,V> void |
buildBounds(CommandArgs<K,V> args)
Subclasses emit their typed
LBOUND/UBOUND here. |
T |
enx()
Apply the expiry only if the key does not already have one (
Expiry only if Not eXists). |
T |
ex(long seconds) |
T |
exAt(long timestampSeconds) |
IncrexArgs |
lbound(long lbound) |
T |
persist() |
T |
px(long milliseconds) |
T |
pxAt(long timestampMilliseconds) |
T |
saturate()
Saturate the result on out-of-bounds: the value is clamped to the violated bound (or the implicit numeric-type limit when
no explicit bound is set), and the second element of the reply reflects the actual applied increment.
|
IncrexArgs |
ubound(long ubound) |
public IncrexArgs lbound(long lbound)
public IncrexArgs ubound(long ubound)
protected <K,V> void buildBounds(CommandArgs<K,V> args)
LBOUND/UBOUND here.public T saturate()
SATURATE, an out-of-bounds operation is silently rejected: the key value and TTL are unchanged and the reply is
[current_value, 0].public T ex(long seconds)
public T px(long milliseconds)
public T exAt(long timestampSeconds)
public T pxAt(long timestampMilliseconds)
public T persist()
public T enx()
Expiry only if Not eXists). If the key already has a
TTL, the existing TTL is preserved.public <K,V> void build(CommandArgs<K,V> args)
CompositeArgumentCommandArgs.
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.
build in interface CompositeArgumentK - Key type.V - Value type.args - the command arguments, must not be null.Copyright © 2026 lettuce.io. All rights reserved.