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

com.cognite.client.servicesV1.executor.AutoValue_RequestExecutor Maven / Gradle / Ivy

There is a newer version: 2.3.3
Show newest version
package com.cognite.client.servicesV1.executor;

import java.util.List;
import java.util.concurrent.Executor;
import javax.annotation.processing.Generated;
import okhttp3.OkHttpClient;

@Generated("com.google.auto.value.processor.AutoValueProcessor")
final class AutoValue_RequestExecutor extends RequestExecutor {

  private final OkHttpClient httpClient;

  private final List validResponseCodes;

  private final Executor executor;

  private final int maxRetries;

  private AutoValue_RequestExecutor(
      OkHttpClient httpClient,
      List validResponseCodes,
      Executor executor,
      int maxRetries) {
    this.httpClient = httpClient;
    this.validResponseCodes = validResponseCodes;
    this.executor = executor;
    this.maxRetries = maxRetries;
  }

  @Override
  OkHttpClient getHttpClient() {
    return httpClient;
  }

  @Override
  List getValidResponseCodes() {
    return validResponseCodes;
  }

  @Override
  Executor getExecutor() {
    return executor;
  }

  @Override
  int getMaxRetries() {
    return maxRetries;
  }

  @Override
  public String toString() {
    return "RequestExecutor{"
        + "httpClient=" + httpClient + ", "
        + "validResponseCodes=" + validResponseCodes + ", "
        + "executor=" + executor + ", "
        + "maxRetries=" + maxRetries
        + "}";
  }

  @Override
  public boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (o instanceof RequestExecutor) {
      RequestExecutor that = (RequestExecutor) o;
      return this.httpClient.equals(that.getHttpClient())
          && this.validResponseCodes.equals(that.getValidResponseCodes())
          && this.executor.equals(that.getExecutor())
          && this.maxRetries == that.getMaxRetries();
    }
    return false;
  }

  @Override
  public int hashCode() {
    int h$ = 1;
    h$ *= 1000003;
    h$ ^= httpClient.hashCode();
    h$ *= 1000003;
    h$ ^= validResponseCodes.hashCode();
    h$ *= 1000003;
    h$ ^= executor.hashCode();
    h$ *= 1000003;
    h$ ^= maxRetries;
    return h$;
  }

  @Override
  RequestExecutor.Builder toBuilder() {
    return new Builder(this);
  }

  static final class Builder extends RequestExecutor.Builder {
    private OkHttpClient httpClient;
    private List validResponseCodes;
    private Executor executor;
    private Integer maxRetries;
    Builder() {
    }
    private Builder(RequestExecutor source) {
      this.httpClient = source.getHttpClient();
      this.validResponseCodes = source.getValidResponseCodes();
      this.executor = source.getExecutor();
      this.maxRetries = source.getMaxRetries();
    }
    @Override
    RequestExecutor.Builder setHttpClient(OkHttpClient httpClient) {
      if (httpClient == null) {
        throw new NullPointerException("Null httpClient");
      }
      this.httpClient = httpClient;
      return this;
    }
    @Override
    RequestExecutor.Builder setValidResponseCodes(List validResponseCodes) {
      if (validResponseCodes == null) {
        throw new NullPointerException("Null validResponseCodes");
      }
      this.validResponseCodes = validResponseCodes;
      return this;
    }
    @Override
    RequestExecutor.Builder setExecutor(Executor executor) {
      if (executor == null) {
        throw new NullPointerException("Null executor");
      }
      this.executor = executor;
      return this;
    }
    @Override
    RequestExecutor.Builder setMaxRetries(int maxRetries) {
      this.maxRetries = maxRetries;
      return this;
    }
    @Override
    RequestExecutor autoBuild() {
      if (this.httpClient == null
          || this.validResponseCodes == null
          || this.executor == null
          || this.maxRetries == null) {
        StringBuilder missing = new StringBuilder();
        if (this.httpClient == null) {
          missing.append(" httpClient");
        }
        if (this.validResponseCodes == null) {
          missing.append(" validResponseCodes");
        }
        if (this.executor == null) {
          missing.append(" executor");
        }
        if (this.maxRetries == null) {
          missing.append(" maxRetries");
        }
        throw new IllegalStateException("Missing required properties:" + missing);
      }
      return new AutoValue_RequestExecutor(
          this.httpClient,
          this.validResponseCodes,
          this.executor,
          this.maxRetries);
    }
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy