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

com.google.cloud.bigquery.AutoValue_QueryResponse Maven / Gradle / Ivy

There is a newer version: 1.0.0-beta1
Show newest version
package com.google.cloud.bigquery;

import com.google.common.collect.ImmutableList;
import javax.annotation.Generated;
import javax.annotation.Nullable;

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

  private final Schema schema;

  private final boolean completed;

  private final long totalRows;

  private final ImmutableList errors;

  private AutoValue_QueryResponse(
      @Nullable Schema schema,
      boolean completed,
      long totalRows,
      ImmutableList errors) {
    this.schema = schema;
    this.completed = completed;
    this.totalRows = totalRows;
    this.errors = errors;
  }

  @Nullable
  @Override
  Schema getSchema() {
    return schema;
  }

  @Override
  boolean getCompleted() {
    return completed;
  }

  @Override
  long getTotalRows() {
    return totalRows;
  }

  @Override
  ImmutableList getErrors() {
    return errors;
  }

  @Override
  public String toString() {
    return "QueryResponse{"
        + "schema=" + schema + ", "
        + "completed=" + completed + ", "
        + "totalRows=" + totalRows + ", "
        + "errors=" + errors
        + "}";
  }

  @Override
  public boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (o instanceof QueryResponse) {
      QueryResponse that = (QueryResponse) o;
      return (this.schema == null ? that.getSchema() == null : this.schema.equals(that.getSchema()))
          && this.completed == that.getCompleted()
          && this.totalRows == that.getTotalRows()
          && this.errors.equals(that.getErrors());
    }
    return false;
  }

  @Override
  public int hashCode() {
    int h$ = 1;
    h$ *= 1000003;
    h$ ^= (schema == null) ? 0 : schema.hashCode();
    h$ *= 1000003;
    h$ ^= completed ? 1231 : 1237;
    h$ *= 1000003;
    h$ ^= (int) ((totalRows >>> 32) ^ totalRows);
    h$ *= 1000003;
    h$ ^= errors.hashCode();
    return h$;
  }

  static final class Builder extends QueryResponse.Builder {
    private Schema schema;
    private Boolean completed;
    private Long totalRows;
    private ImmutableList errors;
    Builder() {
    }
    @Override
    QueryResponse.Builder setSchema(Schema schema) {
      this.schema = schema;
      return this;
    }
    @Override
    QueryResponse.Builder setCompleted(boolean completed) {
      this.completed = completed;
      return this;
    }
    @Override
    QueryResponse.Builder setTotalRows(long totalRows) {
      this.totalRows = totalRows;
      return this;
    }
    @Override
    QueryResponse.Builder setErrors(ImmutableList errors) {
      if (errors == null) {
        throw new NullPointerException("Null errors");
      }
      this.errors = errors;
      return this;
    }
    @Override
    QueryResponse build() {
      if (this.completed == null
          || this.totalRows == null
          || this.errors == null) {
        StringBuilder missing = new StringBuilder();
        if (this.completed == null) {
          missing.append(" completed");
        }
        if (this.totalRows == null) {
          missing.append(" totalRows");
        }
        if (this.errors == null) {
          missing.append(" errors");
        }
        throw new IllegalStateException("Missing required properties:" + missing);
      }
      return new AutoValue_QueryResponse(
          this.schema,
          this.completed,
          this.totalRows,
          this.errors);
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy