diff --git a/java/client/src/test/java/glide/api/models/TransactionTests.java b/java/client/src/test/java/glide/api/models/TransactionTests.java index 886a4c56df..079ee894a9 100644 --- a/java/client/src/test/java/glide/api/models/TransactionTests.java +++ b/java/client/src/test/java/glide/api/models/TransactionTests.java @@ -3,7 +3,14 @@ import static glide.api.commands.SortedSetBaseCommands.WITH_SCORES_REDIS_API; import static glide.api.commands.SortedSetBaseCommands.WITH_SCORE_REDIS_API; +import static glide.api.models.commands.ExpireOptions.HAS_EXISTING_EXPIRY; +import static glide.api.models.commands.ExpireOptions.HAS_NO_EXPIRY; +import static glide.api.models.commands.ExpireOptions.NEW_EXPIRY_LESS_THAN_CURRENT; +import static glide.api.models.commands.InfoOptions.Section.EVERYTHING; +import static glide.api.models.commands.RangeOptions.InfScoreBound.NEGATIVE_INFINITY; +import static glide.api.models.commands.RangeOptions.InfScoreBound.POSITIVE_INFINITY; import static glide.api.models.commands.SetOptions.RETURN_OLD_VALUE; +import static glide.api.models.commands.ZaddOptions.UpdateOptions.SCORE_LESS_THAN_CURRENT; import static org.junit.jupiter.api.Assertions.assertEquals; import static redis_request.RedisRequestOuterClass.RequestType.Blpop; import static redis_request.RedisRequestOuterClass.RequestType.Brpop; @@ -78,9 +85,7 @@ import static redis_request.RedisRequestOuterClass.RequestType.Zrank; import static redis_request.RedisRequestOuterClass.RequestType.Zrem; -import glide.api.models.commands.ExpireOptions; import glide.api.models.commands.InfoOptions; -import glide.api.models.commands.RangeOptions.InfScoreBound; import glide.api.models.commands.RangeOptions.Limit; import glide.api.models.commands.RangeOptions.RangeByScore; import glide.api.models.commands.RangeOptions.ScoreBoundary; @@ -111,275 +116,188 @@ public void transaction_builds_protobuf_request(BaseTransaction transaction) List> results = new LinkedList<>(); transaction.get("key"); - results.add(Pair.of(GetString, ArgsArray.newBuilder().addArgs("key").build())); + results.add(Pair.of(GetString, buildArgs("key"))); transaction.set("key", "value"); - results.add(Pair.of(SetString, ArgsArray.newBuilder().addArgs("key").addArgs("value").build())); + results.add(Pair.of(SetString, buildArgs("key", "value"))); transaction.set("key", "value", SetOptions.builder().returnOldValue(true).build()); - results.add( - Pair.of( - SetString, - ArgsArray.newBuilder() - .addArgs("key") - .addArgs("value") - .addArgs(RETURN_OLD_VALUE) - .build())); + results.add(Pair.of(SetString, buildArgs("key", "value", RETURN_OLD_VALUE))); transaction.del(new String[] {"key1", "key2"}); - results.add(Pair.of(Del, ArgsArray.newBuilder().addArgs("key1").addArgs("key2").build())); + results.add(Pair.of(Del, buildArgs("key1", "key2"))); transaction.echo("GLIDE"); - results.add(Pair.of(Echo, ArgsArray.newBuilder().addArgs("GLIDE").build())); + results.add(Pair.of(Echo, buildArgs("GLIDE"))); transaction.ping(); - results.add(Pair.of(Ping, ArgsArray.newBuilder().build())); + results.add(Pair.of(Ping, buildArgs())); transaction.ping("KING PONG"); - results.add(Pair.of(Ping, ArgsArray.newBuilder().addArgs("KING PONG").build())); + results.add(Pair.of(Ping, buildArgs("KING PONG"))); transaction.info(); - results.add(Pair.of(Info, ArgsArray.newBuilder().build())); + results.add(Pair.of(Info, buildArgs())); - transaction.info(InfoOptions.builder().section(InfoOptions.Section.EVERYTHING).build()); - results.add( - Pair.of( - Info, - ArgsArray.newBuilder().addArgs(InfoOptions.Section.EVERYTHING.toString()).build())); + transaction.info(InfoOptions.builder().section(EVERYTHING).build()); + results.add(Pair.of(Info, buildArgs(EVERYTHING.toString()))); transaction.mset(Map.of("key", "value")); - results.add(Pair.of(MSet, ArgsArray.newBuilder().addArgs("key").addArgs("value").build())); + results.add(Pair.of(MSet, buildArgs("key", "value"))); transaction.mget(new String[] {"key"}); - results.add(Pair.of(MGet, ArgsArray.newBuilder().addArgs("key").build())); + results.add(Pair.of(MGet, buildArgs("key"))); transaction.incr("key"); - results.add(Pair.of(Incr, ArgsArray.newBuilder().addArgs("key").build())); + results.add(Pair.of(Incr, buildArgs("key"))); transaction.incrBy("key", 1); - results.add(Pair.of(IncrBy, ArgsArray.newBuilder().addArgs("key").addArgs("1").build())); + results.add(Pair.of(IncrBy, buildArgs("key", "1"))); transaction.incrByFloat("key", 2.5); - results.add(Pair.of(IncrByFloat, ArgsArray.newBuilder().addArgs("key").addArgs("2.5").build())); + results.add(Pair.of(IncrByFloat, buildArgs("key", "2.5"))); transaction.decr("key"); - results.add(Pair.of(Decr, ArgsArray.newBuilder().addArgs("key").build())); + results.add(Pair.of(Decr, buildArgs("key"))); transaction.decrBy("key", 2); - results.add(Pair.of(DecrBy, ArgsArray.newBuilder().addArgs("key").addArgs("2").build())); + results.add(Pair.of(DecrBy, buildArgs("key", "2"))); transaction.strlen("key"); - results.add(Pair.of(Strlen, ArgsArray.newBuilder().addArgs("key").build())); + results.add(Pair.of(Strlen, buildArgs("key"))); transaction.hset("key", Map.of("field", "value")); - results.add( - Pair.of( - HashSet, - ArgsArray.newBuilder().addArgs("key").addArgs("field").addArgs("value").build())); + results.add(Pair.of(HashSet, buildArgs("key", "field", "value"))); transaction.hsetnx("key", "field", "value"); - results.add( - Pair.of( - HSetNX, - ArgsArray.newBuilder().addArgs("key").addArgs("field").addArgs("value").build())); + results.add(Pair.of(HSetNX, buildArgs("key", "field", "value"))); transaction.hget("key", "field"); - results.add(Pair.of(HashGet, ArgsArray.newBuilder().addArgs("key").addArgs("field").build())); + results.add(Pair.of(HashGet, buildArgs("key", "field"))); transaction.hdel("key", new String[] {"field"}); - results.add(Pair.of(HashDel, ArgsArray.newBuilder().addArgs("key").addArgs("field").build())); + results.add(Pair.of(HashDel, buildArgs("key", "field"))); transaction.hlen("key"); - results.add(Pair.of(HLen, ArgsArray.newBuilder().addArgs("key").build())); + results.add(Pair.of(HLen, buildArgs("key"))); transaction.hvals("key"); - results.add(Pair.of(Hvals, ArgsArray.newBuilder().addArgs("key").build())); + results.add(Pair.of(Hvals, buildArgs("key"))); transaction.hmget("key", new String[] {"field"}); - results.add(Pair.of(HashMGet, ArgsArray.newBuilder().addArgs("key").addArgs("field").build())); + results.add(Pair.of(HashMGet, buildArgs("key", "field"))); transaction.hexists("key", "field"); - results.add( - Pair.of(HashExists, ArgsArray.newBuilder().addArgs("key").addArgs("field").build())); + results.add(Pair.of(HashExists, buildArgs("key", "field"))); transaction.hgetall("key"); - results.add(Pair.of(HashGetAll, ArgsArray.newBuilder().addArgs("key").build())); + results.add(Pair.of(HashGetAll, buildArgs("key"))); transaction.hincrBy("key", "field", 1); - results.add( - Pair.of( - HashIncrBy, - ArgsArray.newBuilder().addArgs("key").addArgs("field").addArgs("1").build())); + results.add(Pair.of(HashIncrBy, buildArgs("key", "field", "1"))); transaction.hincrByFloat("key", "field", 1.5); - results.add( - Pair.of( - HashIncrByFloat, - ArgsArray.newBuilder().addArgs("key").addArgs("field").addArgs("1.5").build())); + results.add(Pair.of(HashIncrByFloat, buildArgs("key", "field", "1.5"))); transaction.lpush("key", new String[] {"element1", "element2"}); - results.add( - Pair.of( - LPush, - ArgsArray.newBuilder().addArgs("key").addArgs("element1").addArgs("element2").build())); + results.add(Pair.of(LPush, buildArgs("key", "element1", "element2"))); transaction.lpop("key"); - results.add(Pair.of(LPop, ArgsArray.newBuilder().addArgs("key").build())); + results.add(Pair.of(LPop, buildArgs("key"))); transaction.lpopCount("key", 2); - results.add(Pair.of(LPop, ArgsArray.newBuilder().addArgs("key").addArgs("2").build())); + results.add(Pair.of(LPop, buildArgs("key", "2"))); transaction.lrange("key", 1, 2); - results.add( - Pair.of(LRange, ArgsArray.newBuilder().addArgs("key").addArgs("1").addArgs("2").build())); + results.add(Pair.of(LRange, buildArgs("key", "1", "2"))); transaction.lindex("key", 1); results.add(Pair.of(Lindex, ArgsArray.newBuilder().addArgs("key").addArgs("1").build())); transaction.ltrim("key", 1, 2); - results.add( - Pair.of(LTrim, ArgsArray.newBuilder().addArgs("key").addArgs("1").addArgs("2").build())); + results.add(Pair.of(LTrim, buildArgs("key", "1", "2"))); transaction.llen("key"); - results.add(Pair.of(LLen, ArgsArray.newBuilder().addArgs("key").build())); + results.add(Pair.of(LLen, buildArgs("key"))); transaction.lrem("key", 1, "element"); - results.add( - Pair.of( - LRem, ArgsArray.newBuilder().addArgs("key").addArgs("1").addArgs("element").build())); + results.add(Pair.of(LRem, buildArgs("key", "1", "element"))); transaction.rpush("key", new String[] {"element"}); - results.add(Pair.of(RPush, ArgsArray.newBuilder().addArgs("key").addArgs("element").build())); + results.add(Pair.of(RPush, buildArgs("key", "element"))); transaction.rpop("key"); - results.add(Pair.of(RPop, ArgsArray.newBuilder().addArgs("key").build())); + results.add(Pair.of(RPop, buildArgs("key"))); transaction.rpopCount("key", 2); - results.add(Pair.of(RPop, ArgsArray.newBuilder().addArgs("key").addArgs("2").build())); + results.add(Pair.of(RPop, buildArgs("key", "2"))); transaction.sadd("key", new String[] {"value"}); - results.add(Pair.of(SAdd, ArgsArray.newBuilder().addArgs("key").addArgs("value").build())); + results.add(Pair.of(SAdd, buildArgs("key", "value"))); transaction.sismember("key", "member"); results.add( Pair.of(SIsMember, ArgsArray.newBuilder().addArgs("key").addArgs("member").build())); transaction.srem("key", new String[] {"value"}); - results.add(Pair.of(SRem, ArgsArray.newBuilder().addArgs("key").addArgs("value").build())); + results.add(Pair.of(SRem, buildArgs("key", "value"))); transaction.smembers("key"); - results.add(Pair.of(SMembers, ArgsArray.newBuilder().addArgs("key").build())); + results.add(Pair.of(SMembers, buildArgs("key"))); transaction.scard("key"); - results.add(Pair.of(SCard, ArgsArray.newBuilder().addArgs("key").build())); + results.add(Pair.of(SCard, buildArgs("key"))); transaction.exists(new String[] {"key1", "key2"}); - results.add(Pair.of(Exists, ArgsArray.newBuilder().addArgs("key1").addArgs("key2").build())); + results.add(Pair.of(Exists, buildArgs("key1", "key2"))); transaction.unlink(new String[] {"key1", "key2"}); - results.add(Pair.of(Unlink, ArgsArray.newBuilder().addArgs("key1").addArgs("key2").build())); + results.add(Pair.of(Unlink, buildArgs("key1", "key2"))); transaction.expire("key", 9L); - results.add( - Pair.of(Expire, ArgsArray.newBuilder().addArgs("key").addArgs(Long.toString(9L)).build())); - - transaction.expire("key", 99L, ExpireOptions.NEW_EXPIRY_GREATER_THAN_CURRENT); - results.add( - Pair.of( - Expire, - ArgsArray.newBuilder() - .addArgs("key") - .addArgs(Long.toString(99L)) - .addArgs("GT") - .build())); - - transaction.expireAt("key", 999L); - results.add( - Pair.of( - ExpireAt, ArgsArray.newBuilder().addArgs("key").addArgs(Long.toString(999L)).build())); - - transaction.expireAt("key", 9999L, ExpireOptions.NEW_EXPIRY_LESS_THAN_CURRENT); - results.add( - Pair.of( - ExpireAt, - ArgsArray.newBuilder() - .addArgs("key") - .addArgs(Long.toString(9999L)) - .addArgs("LT") - .build())); + results.add(Pair.of(Expire, buildArgs("key", "9"))); + transaction.expireAt("key", 9999L, NEW_EXPIRY_LESS_THAN_CURRENT); + results.add(Pair.of(ExpireAt, buildArgs("key", "9999", "LT"))); transaction.pexpire("key", 99999L); - results.add( - Pair.of( - PExpire, ArgsArray.newBuilder().addArgs("key").addArgs(Long.toString(99999L)).build())); + results.add(Pair.of(PExpire, buildArgs("key", "99999"))); - transaction.pexpire("key", 999999L, ExpireOptions.HAS_EXISTING_EXPIRY); - results.add( - Pair.of( - PExpire, - ArgsArray.newBuilder() - .addArgs("key") - .addArgs(Long.toString(999999L)) - .addArgs("XX") - .build())); + transaction.pexpire("key", 999999L, HAS_EXISTING_EXPIRY); + results.add(Pair.of(PExpire, buildArgs("key", "999999", "XX"))); transaction.pexpireAt("key", 9999999L); - results.add( - Pair.of( - PExpireAt, - ArgsArray.newBuilder().addArgs("key").addArgs(Long.toString(9999999L)).build())); + results.add(Pair.of(PExpireAt, buildArgs("key", "9999999"))); - transaction.pexpireAt("key", 99999999L, ExpireOptions.HAS_NO_EXPIRY); - results.add( - Pair.of( - PExpireAt, - ArgsArray.newBuilder() - .addArgs("key") - .addArgs(Long.toString(99999999L)) - .addArgs("NX") - .build())); + transaction.pexpireAt("key", 99999999L, HAS_NO_EXPIRY); + results.add(Pair.of(PExpireAt, buildArgs("key", "99999999", "NX"))); transaction.ttl("key"); - results.add(Pair.of(TTL, ArgsArray.newBuilder().addArgs("key").build())); + results.add(Pair.of(TTL, buildArgs("key"))); transaction.pttl("key"); - results.add(Pair.of(PTTL, ArgsArray.newBuilder().addArgs("key").build())); + results.add(Pair.of(PTTL, buildArgs("key"))); transaction.clientId(); - results.add(Pair.of(ClientId, ArgsArray.newBuilder().build())); + results.add(Pair.of(ClientId, buildArgs())); transaction.clientGetName(); - results.add(Pair.of(ClientGetName, ArgsArray.newBuilder().build())); + results.add(Pair.of(ClientGetName, buildArgs())); transaction.configRewrite(); - results.add(Pair.of(ConfigRewrite, ArgsArray.newBuilder().build())); + results.add(Pair.of(ConfigRewrite, buildArgs())); transaction.configResetStat(); - results.add(Pair.of(ConfigResetStat, ArgsArray.newBuilder().build())); + results.add(Pair.of(ConfigResetStat, buildArgs())); transaction.configGet(new String[] {"maxmemory", "hash-max-listpack-entries"}); - results.add( - Pair.of( - ConfigGet, - ArgsArray.newBuilder() - .addArgs("maxmemory") - .addArgs("hash-max-listpack-entries") - .build())); + results.add(Pair.of(ConfigGet, buildArgs("maxmemory", "hash-max-listpack-entries"))); var configSetMap = new LinkedHashMap(); configSetMap.put("maxmemory", "100mb"); configSetMap.put("save", "60"); transaction.configSet(configSetMap); - results.add( - Pair.of( - ConfigSet, - ArgsArray.newBuilder() - .addArgs("maxmemory") - .addArgs("100mb") - .addArgs("save") - .addArgs("60") - .build())); + results.add(Pair.of(ConfigSet, buildArgs("maxmemory", "100mb", "save", "60"))); Map membersScores = new LinkedHashMap<>(); membersScores.put("member1", 1.0); @@ -387,173 +305,88 @@ public void transaction_builds_protobuf_request(BaseTransaction transaction) transaction.zadd( "key", membersScores, - ZaddOptions.builder() - .updateOptions(ZaddOptions.UpdateOptions.SCORE_LESS_THAN_CURRENT) - .build(), + ZaddOptions.builder().updateOptions(SCORE_LESS_THAN_CURRENT).build(), true); - results.add( - Pair.of( - Zadd, - ArgsArray.newBuilder() - .addArgs("key") - .addArgs("LT") - .addArgs("CH") - .addArgs("1.0") - .addArgs("member1") - .addArgs("2.0") - .addArgs("member2") - .build())); + results.add(Pair.of(Zadd, buildArgs("key", "LT", "CH", "1.0", "member1", "2.0", "member2"))); transaction.zaddIncr( "key", "member1", 3.0, - ZaddOptions.builder() - .updateOptions(ZaddOptions.UpdateOptions.SCORE_LESS_THAN_CURRENT) - .build()); - results.add( - Pair.of( - Zadd, - ArgsArray.newBuilder() - .addArgs("key") - .addArgs("LT") - .addArgs("INCR") - .addArgs("3.0") - .addArgs("member1") - .build())); + ZaddOptions.builder().updateOptions(SCORE_LESS_THAN_CURRENT).build()); + results.add(Pair.of(Zadd, buildArgs("key", "LT", "INCR", "3.0", "member1"))); transaction.zrem("key", new String[] {"member1", "member2"}); - results.add( - Pair.of( - Zrem, - ArgsArray.newBuilder().addArgs("key").addArgs("member1").addArgs("member2").build())); + results.add(Pair.of(Zrem, buildArgs("key", "member1", "member2"))); transaction.zcard("key"); - results.add(Pair.of(Zcard, ArgsArray.newBuilder().addArgs("key").build())); + results.add(Pair.of(Zcard, buildArgs("key"))); transaction.zpopmin("key"); - results.add(Pair.of(ZPopMin, ArgsArray.newBuilder().addArgs("key").build())); + results.add(Pair.of(ZPopMin, buildArgs("key"))); transaction.zpopmin("key", 2); - results.add(Pair.of(ZPopMin, ArgsArray.newBuilder().addArgs("key").addArgs("2").build())); + results.add(Pair.of(ZPopMin, buildArgs("key", "2"))); transaction.zpopmax("key"); - results.add(Pair.of(ZPopMax, ArgsArray.newBuilder().addArgs("key").build())); + results.add(Pair.of(ZPopMax, buildArgs("key"))); transaction.zpopmax("key", 2); - results.add(Pair.of(ZPopMax, ArgsArray.newBuilder().addArgs("key").addArgs("2").build())); + results.add(Pair.of(ZPopMax, buildArgs("key", "2"))); transaction.zscore("key", "member"); - results.add(Pair.of(ZScore, ArgsArray.newBuilder().addArgs("key").addArgs("member").build())); + results.add(Pair.of(ZScore, buildArgs("key", "member"))); transaction.zrank("key", "member"); - results.add(Pair.of(Zrank, ArgsArray.newBuilder().addArgs("key").addArgs("member").build())); + results.add(Pair.of(Zrank, buildArgs("key", "member"))); transaction.zrankWithScore("key", "member"); - results.add( - Pair.of( - Zrank, - ArgsArray.newBuilder() - .addArgs("key") - .addArgs("member") - .addArgs(WITH_SCORE_REDIS_API) - .build())); + results.add(Pair.of(Zrank, buildArgs("key", "member", WITH_SCORE_REDIS_API))); transaction.xadd("key", Map.of("field1", "foo1")); - results.add( - Pair.of( - XAdd, - ArgsArray.newBuilder() - .addArgs("key") - .addArgs("*") - .addArgs("field1") - .addArgs("foo1") - .build())); + results.add(Pair.of(XAdd, buildArgs("key", "*", "field1", "foo1"))); transaction.xadd("key", Map.of("field1", "foo1"), StreamAddOptions.builder().id("id").build()); - results.add( - Pair.of( - XAdd, - ArgsArray.newBuilder() - .addArgs("key") - .addArgs("id") - .addArgs("field1") - .addArgs("foo1") - .build())); + results.add(Pair.of(XAdd, buildArgs("key", "id", "field1", "foo1"))); transaction.time(); - results.add(Pair.of(Time, ArgsArray.newBuilder().build())); + results.add(Pair.of(Time, buildArgs())); transaction.persist("key"); - results.add(Pair.of(Persist, ArgsArray.newBuilder().addArgs("key").build())); + results.add(Pair.of(Persist, buildArgs("key"))); transaction.type("key"); - results.add(Pair.of(Type, ArgsArray.newBuilder().addArgs("key").build())); + results.add(Pair.of(Type, buildArgs("key"))); transaction.brpop(new String[] {"key1", "key2"}, 0.5); - results.add( - Pair.of( - Brpop, ArgsArray.newBuilder().addArgs("key1").addArgs("key2").addArgs("0.5").build())); + results.add(Pair.of(Brpop, buildArgs("key1", "key2", "0.5"))); transaction.blpop(new String[] {"key1", "key2"}, 0.5); - results.add( - Pair.of( - Blpop, ArgsArray.newBuilder().addArgs("key1").addArgs("key2").addArgs("0.5").build())); + results.add(Pair.of(Blpop, buildArgs("key1", "key2", "0.5"))); transaction.rpushx("key", new String[] {"element1", "element2"}); - results.add( - Pair.of( - RPushX, - ArgsArray.newBuilder().addArgs("key").addArgs("element1").addArgs("element2").build())); + results.add(Pair.of(RPushX, buildArgs("key", "element1", "element2"))); transaction.lpushx("key", new String[] {"element1", "element2"}); - results.add( - Pair.of( - LPushX, - ArgsArray.newBuilder().addArgs("key").addArgs("element1").addArgs("element2").build())); + results.add(Pair.of(LPushX, buildArgs("key", "element1", "element2"))); transaction.zrange( "key", - new RangeByScore( - InfScoreBound.NEGATIVE_INFINITY, new ScoreBoundary(3, false), new Limit(1, 2)), + new RangeByScore(NEGATIVE_INFINITY, new ScoreBoundary(3, false), new Limit(1, 2)), true); results.add( - Pair.of( - Zrange, - ArgsArray.newBuilder() - .addArgs("key") - .addArgs("-inf") - .addArgs("(3.0") - .addArgs("BYSCORE") - .addArgs("REV") - .addArgs("LIMIT") - .addArgs("1") - .addArgs("2") - .build())); + Pair.of(Zrange, buildArgs("key", "-inf", "(3.0", "BYSCORE", "REV", "LIMIT", "1", "2"))); transaction.zrangeWithScores( "key", - new RangeByScore( - new ScoreBoundary(5, true), InfScoreBound.POSITIVE_INFINITY, new Limit(1, 2)), + new RangeByScore(new ScoreBoundary(5, true), POSITIVE_INFINITY, new Limit(1, 2)), false); results.add( Pair.of( Zrange, - ArgsArray.newBuilder() - .addArgs("key") - .addArgs("5.0") - .addArgs("+inf") - .addArgs("BYSCORE") - .addArgs("LIMIT") - .addArgs("1") - .addArgs("2") - .addArgs(WITH_SCORES_REDIS_API) - .build())); + buildArgs("key", "5.0", "+inf", "BYSCORE", "LIMIT", "1", "2", WITH_SCORES_REDIS_API))); transaction.pfadd("hll", new String[] {"a", "b", "c"}); - results.add( - Pair.of( - PfAdd, - ArgsArray.newBuilder().addArgs("hll").addArgs("a").addArgs("b").addArgs("c").build())); + results.add(Pair.of(PfAdd, buildArgs("hll", "a", "b", "c"))); transaction.pfcount(new String[] {"hll1", "hll2"}); results.add(Pair.of(PfCount, ArgsArray.newBuilder().addArgs("hll1").addArgs("hll2").build())); @@ -574,4 +407,12 @@ InfScoreBound.NEGATIVE_INFINITY, new ScoreBoundary(3, false), new Limit(1, 2)), assertEquals(results.get(idx).getRight(), protobuf.getArgsArray()); } } + + private ArgsArray buildArgs(String... args) { + var builder = ArgsArray.newBuilder(); + for (var arg : args) { + builder.addArgs(arg); + } + return builder.build(); + } }