All Downloads are FREE. Search and download functionalities are using the official Maven repository.

redis.clients.jedis.params.ModuleLoadExParams Maven / Gradle / Ivy

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);
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy