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

com.linkedin.restli.client.ParSeqRestliClientConfigBuilder Maven / Gradle / Ivy

There is a newer version: 4.0.1
Show newest version
package com.linkedin.restli.client;

import java.util.HashMap;
import java.util.Map;

public class ParSeqRestliClientConfigBuilder {

  private final Map _timeoutMsConfig = new HashMap<>();
  private final Map _batchingEnabledConfig = new HashMap<>();
  private final Map _maxBatchSizeConfig = new HashMap<>();

  public ParSeqRestliClientConfigBuilder() {
  }

  public ParSeqRestliClientConfigBuilder(ParSeqRestliClientConfig config) {
    addConfig(config);
  }

  public void addConfig(ParSeqRestliClientConfig config) {
    addTimeoutMsConfigMap(config.getTimeoutMsConfig());
    addBatchingEnabledConfigMap(config.isBatchingEnabledConfig());
    addMaxBatchSizeConfigMap(config.getMaxBatchSizeConfig());
  }

  public ParSeqRestliClientConfig build() {
    return new ParSeqRestliClientConfigImpl(_timeoutMsConfig, _batchingEnabledConfig, _maxBatchSizeConfig);
  }

  public ParSeqRestliClientConfigBuilder addTimeoutMs(String key, long value) {
    _timeoutMsConfig.put(key, value);
    return this;
  }

  public ParSeqRestliClientConfigBuilder addTimeoutMsConfigMap(Map config) {
    _timeoutMsConfig.putAll(config);
    return this;
  }

  public ParSeqRestliClientConfigBuilder addBatchingEnabled(String key, boolean value) {
    _batchingEnabledConfig.put(key, value);
    return this;
  }

  public ParSeqRestliClientConfigBuilder addBatchingEnabledConfigMap(Map config) {
    _batchingEnabledConfig.putAll(config);
    return this;
  }

  public ParSeqRestliClientConfigBuilder addMaxBatchSize(String key, int value) {
    _maxBatchSizeConfig.put(key, value);
    return this;
  }

  public ParSeqRestliClientConfigBuilder addMaxBatchSizeConfigMap(Map config) {
    _maxBatchSizeConfig.putAll(config);
    return this;
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy