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

annotations.com.cognite.client.AutoValue_Request Maven / Gradle / Ivy

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

import com.cognite.client.config.AuthConfig;
import com.google.common.collect.ImmutableMap;
import com.google.protobuf.Message;
import java.util.Map;
import javax.annotation.Nullable;
import javax.annotation.processing.Generated;

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

  private final ImmutableMap requestParameters;

  private final Message protoRequestBody;

  private final AuthConfig authConfig;

  private AutoValue_Request(
      ImmutableMap requestParameters,
      @Nullable Message protoRequestBody,
      @Nullable AuthConfig authConfig) {
    this.requestParameters = requestParameters;
    this.protoRequestBody = protoRequestBody;
    this.authConfig = authConfig;
  }

  @Override
  public ImmutableMap getRequestParameters() {
    return requestParameters;
  }

  @Nullable
  @Override
  public Message getProtoRequestBody() {
    return protoRequestBody;
  }

  @Nullable
  @Override
  public AuthConfig getAuthConfig() {
    return authConfig;
  }

  @Override
  public String toString() {
    return "Request{"
        + "requestParameters=" + requestParameters + ", "
        + "protoRequestBody=" + protoRequestBody + ", "
        + "authConfig=" + authConfig
        + "}";
  }

  @Override
  public boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (o instanceof Request) {
      Request that = (Request) o;
      return this.requestParameters.equals(that.getRequestParameters())
          && (this.protoRequestBody == null ? that.getProtoRequestBody() == null : this.protoRequestBody.equals(that.getProtoRequestBody()))
          && (this.authConfig == null ? that.getAuthConfig() == null : this.authConfig.equals(that.getAuthConfig()));
    }
    return false;
  }

  @Override
  public int hashCode() {
    int h$ = 1;
    h$ *= 1000003;
    h$ ^= requestParameters.hashCode();
    h$ *= 1000003;
    h$ ^= (protoRequestBody == null) ? 0 : protoRequestBody.hashCode();
    h$ *= 1000003;
    h$ ^= (authConfig == null) ? 0 : authConfig.hashCode();
    return h$;
  }

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

  static final class Builder extends Request.Builder {
    private ImmutableMap.Builder requestParametersBuilder$;
    private ImmutableMap requestParameters;
    private Message protoRequestBody;
    private AuthConfig authConfig;
    Builder() {
    }
    private Builder(Request source) {
      this.requestParameters = source.getRequestParameters();
      this.protoRequestBody = source.getProtoRequestBody();
      this.authConfig = source.getAuthConfig();
    }
    @Override
    Request.Builder setRequestParameters(Map requestParameters) {
      if (requestParametersBuilder$ != null) {
        throw new IllegalStateException("Cannot set requestParameters after calling requestParametersBuilder()");
      }
      this.requestParameters = ImmutableMap.copyOf(requestParameters);
      return this;
    }
    @Override
    ImmutableMap.Builder requestParametersBuilder() {
      if (requestParametersBuilder$ == null) {
        if (requestParameters == null) {
          requestParametersBuilder$ = ImmutableMap.builder();
        } else {
          requestParametersBuilder$ = ImmutableMap.builder();
          requestParametersBuilder$.putAll(requestParameters);
          requestParameters = null;
        }
      }
      return requestParametersBuilder$;
    }
    @Override
    Request.Builder setProtoRequestBody(Message protoRequestBody) {
      this.protoRequestBody = protoRequestBody;
      return this;
    }
    @Override
    Request.Builder setAuthConfig(AuthConfig authConfig) {
      this.authConfig = authConfig;
      return this;
    }
    @Override
    public Request build() {
      if (requestParametersBuilder$ != null) {
        this.requestParameters = requestParametersBuilder$.build();
      } else if (this.requestParameters == null) {
        this.requestParameters = ImmutableMap.of();
      }
      return new AutoValue_Request(
          this.requestParameters,
          this.protoRequestBody,
          this.authConfig);
    }
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy