com.google.cloud.bigquery.AutoValue_QueryResponse Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of google-cloud-bigquery Show documentation
Show all versions of google-cloud-bigquery Show documentation
Java idiomatic client for Google Cloud BigQuery.
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 {
@Nullable
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;
private byte set$0;
Builder() {
}
@Override
QueryResponse.Builder setSchema(Schema schema) {
this.schema = schema;
return this;
}
@Override
QueryResponse.Builder setCompleted(boolean completed) {
this.completed = completed;
set$0 |= (byte) 1;
return this;
}
@Override
QueryResponse.Builder setTotalRows(long totalRows) {
this.totalRows = totalRows;
set$0 |= (byte) 2;
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 (set$0 != 3
|| this.errors == null) {
StringBuilder missing = new StringBuilder();
if ((set$0 & 1) == 0) {
missing.append(" completed");
}
if ((set$0 & 2) == 0) {
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);
}
}
}