diff --git a/src/main/java/io/lettuce/core/SetArgs.java b/src/main/java/io/lettuce/core/SetArgs.java index c0eaf136b3..43394b1880 100644 --- a/src/main/java/io/lettuce/core/SetArgs.java +++ b/src/main/java/io/lettuce/core/SetArgs.java @@ -15,6 +15,8 @@ */ package io.lettuce.core; +import static io.lettuce.core.protocol.CommandKeyword.*; + import java.time.Duration; import java.time.Instant; import java.util.Date; @@ -397,11 +399,11 @@ public void build(CommandArgs args) { } if (nx) { - args.add("NX"); + args.add(NX); } if (xx) { - args.add("XX"); + args.add(XX); } if (keepttl) { diff --git a/src/main/java/io/lettuce/core/ZAddArgs.java b/src/main/java/io/lettuce/core/ZAddArgs.java index 12b5bb8cf8..6a57da94fc 100644 --- a/src/main/java/io/lettuce/core/ZAddArgs.java +++ b/src/main/java/io/lettuce/core/ZAddArgs.java @@ -15,6 +15,8 @@ */ package io.lettuce.core; +import static io.lettuce.core.protocol.CommandKeyword.*; + import io.lettuce.core.protocol.CommandArgs; /** @@ -164,14 +166,15 @@ public ZAddArgs lt() { return this; } + @Override public void build(CommandArgs args) { if (nx) { - args.add("NX"); + args.add(NX); } if (xx) { - args.add("XX"); + args.add(XX); } if (gt) { @@ -183,7 +186,7 @@ public void build(CommandArgs args) { } if (ch) { - args.add("CH"); + args.add(CH); } }