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

com.cognite.client.AutoValue_ApiBase_DeleteItems 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.cognite.client.dto.Item;
import com.cognite.client.servicesV1.ConnectorServiceV1;
import com.google.common.collect.ImmutableMap;
import java.util.Map;
import java.util.function.Function;
import javax.annotation.processing.Generated;

@Generated("com.google.auto.value.processor.AutoValueProcessor")
final class AutoValue_ApiBase_DeleteItems extends ApiBase.DeleteItems {

  private final int maxBatchSize;

  private final AuthConfig authConfig;

  private final Function> deleteItemMappingFunction;

  private final ConnectorServiceV1.ItemWriter deleteItemWriter;

  private final ImmutableMap parameters;

  private AutoValue_ApiBase_DeleteItems(
      int maxBatchSize,
      AuthConfig authConfig,
      Function> deleteItemMappingFunction,
      ConnectorServiceV1.ItemWriter deleteItemWriter,
      ImmutableMap parameters) {
    this.maxBatchSize = maxBatchSize;
    this.authConfig = authConfig;
    this.deleteItemMappingFunction = deleteItemMappingFunction;
    this.deleteItemWriter = deleteItemWriter;
    this.parameters = parameters;
  }

  @Override
  int getMaxBatchSize() {
    return maxBatchSize;
  }

  @Override
  AuthConfig getAuthConfig() {
    return authConfig;
  }

  @Override
  Function> getDeleteItemMappingFunction() {
    return deleteItemMappingFunction;
  }

  @Override
  ConnectorServiceV1.ItemWriter getDeleteItemWriter() {
    return deleteItemWriter;
  }

  @Override
  ImmutableMap getParameters() {
    return parameters;
  }

  @Override
  public String toString() {
    return "DeleteItems{"
        + "maxBatchSize=" + maxBatchSize + ", "
        + "authConfig=" + authConfig + ", "
        + "deleteItemMappingFunction=" + deleteItemMappingFunction + ", "
        + "deleteItemWriter=" + deleteItemWriter + ", "
        + "parameters=" + parameters
        + "}";
  }

  @Override
  public boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (o instanceof ApiBase.DeleteItems) {
      ApiBase.DeleteItems that = (ApiBase.DeleteItems) o;
      return this.maxBatchSize == that.getMaxBatchSize()
          && this.authConfig.equals(that.getAuthConfig())
          && this.deleteItemMappingFunction.equals(that.getDeleteItemMappingFunction())
          && this.deleteItemWriter.equals(that.getDeleteItemWriter())
          && this.parameters.equals(that.getParameters());
    }
    return false;
  }

  @Override
  public int hashCode() {
    int h$ = 1;
    h$ *= 1000003;
    h$ ^= maxBatchSize;
    h$ *= 1000003;
    h$ ^= authConfig.hashCode();
    h$ *= 1000003;
    h$ ^= deleteItemMappingFunction.hashCode();
    h$ *= 1000003;
    h$ ^= deleteItemWriter.hashCode();
    h$ *= 1000003;
    h$ ^= parameters.hashCode();
    return h$;
  }

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

  static final class Builder extends ApiBase.DeleteItems.Builder {
    private Integer maxBatchSize;
    private AuthConfig authConfig;
    private Function> deleteItemMappingFunction;
    private ConnectorServiceV1.ItemWriter deleteItemWriter;
    private ImmutableMap.Builder parametersBuilder$;
    private ImmutableMap parameters;
    Builder() {
    }
    private Builder(ApiBase.DeleteItems source) {
      this.maxBatchSize = source.getMaxBatchSize();
      this.authConfig = source.getAuthConfig();
      this.deleteItemMappingFunction = source.getDeleteItemMappingFunction();
      this.deleteItemWriter = source.getDeleteItemWriter();
      this.parameters = source.getParameters();
    }
    @Override
    ApiBase.DeleteItems.Builder setMaxBatchSize(int maxBatchSize) {
      this.maxBatchSize = maxBatchSize;
      return this;
    }
    @Override
    ApiBase.DeleteItems.Builder setAuthConfig(AuthConfig authConfig) {
      if (authConfig == null) {
        throw new NullPointerException("Null authConfig");
      }
      this.authConfig = authConfig;
      return this;
    }
    @Override
    ApiBase.DeleteItems.Builder setDeleteItemMappingFunction(Function> deleteItemMappingFunction) {
      if (deleteItemMappingFunction == null) {
        throw new NullPointerException("Null deleteItemMappingFunction");
      }
      this.deleteItemMappingFunction = deleteItemMappingFunction;
      return this;
    }
    @Override
    ApiBase.DeleteItems.Builder setDeleteItemWriter(ConnectorServiceV1.ItemWriter deleteItemWriter) {
      if (deleteItemWriter == null) {
        throw new NullPointerException("Null deleteItemWriter");
      }
      this.deleteItemWriter = deleteItemWriter;
      return this;
    }
    @Override
    ApiBase.DeleteItems.Builder setParameters(Map parameters) {
      if (parametersBuilder$ != null) {
        throw new IllegalStateException("Cannot set parameters after calling parametersBuilder()");
      }
      this.parameters = ImmutableMap.copyOf(parameters);
      return this;
    }
    @Override
    ImmutableMap.Builder parametersBuilder() {
      if (parametersBuilder$ == null) {
        if (parameters == null) {
          parametersBuilder$ = ImmutableMap.builder();
        } else {
          parametersBuilder$ = ImmutableMap.builder();
          parametersBuilder$.putAll(parameters);
          parameters = null;
        }
      }
      return parametersBuilder$;
    }
    @Override
    ApiBase.DeleteItems build() {
      if (parametersBuilder$ != null) {
        this.parameters = parametersBuilder$.build();
      } else if (this.parameters == null) {
        this.parameters = ImmutableMap.of();
      }
      if (this.maxBatchSize == null
          || this.authConfig == null
          || this.deleteItemMappingFunction == null
          || this.deleteItemWriter == null) {
        StringBuilder missing = new StringBuilder();
        if (this.maxBatchSize == null) {
          missing.append(" maxBatchSize");
        }
        if (this.authConfig == null) {
          missing.append(" authConfig");
        }
        if (this.deleteItemMappingFunction == null) {
          missing.append(" deleteItemMappingFunction");
        }
        if (this.deleteItemWriter == null) {
          missing.append(" deleteItemWriter");
        }
        throw new IllegalStateException("Missing required properties:" + missing);
      }
      return new AutoValue_ApiBase_DeleteItems(
          this.maxBatchSize,
          this.authConfig,
          this.deleteItemMappingFunction,
          this.deleteItemWriter,
          this.parameters);
    }
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy