redis.clients.jedis.params.ModuleLoadExParams Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jedis_preview Show documentation
Show all versions of jedis_preview Show documentation
Jedis is a blazingly small and sane Redis java client.
The newest version!
package redis.clients.jedis.params;
import java.util.ArrayList;
import java.util.List;
import redis.clients.jedis.CommandArguments;
import redis.clients.jedis.Protocol.Keyword;
import redis.clients.jedis.util.KeyValue;
public class ModuleLoadExParams implements IParams {
private final List> configs = new ArrayList<>();
private final List args = new ArrayList<>();
public ModuleLoadExParams() {
}
public ModuleLoadExParams moduleLoadexParams() {
return new ModuleLoadExParams();
}
public ModuleLoadExParams config(String name, String value) {
this.configs.add(KeyValue.of(name, value));
return this;
}
public ModuleLoadExParams arg(String arg) {
this.args.add(arg);
return this;
}
@Override
public void addParams(CommandArguments args) {
this.configs.forEach(kv -> args.add(Keyword.CONFIG).add(kv.getKey()).add(kv.getValue()));
if (!this.args.isEmpty()) {
args.add(Keyword.ARGS).addObjects(this.args);
}
}
}