Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

package com.google.cloud.bigquery;

import static com.google.common.base.Preconditions.checkArgument;

import com.google.api.services.bigquery.model.QueryParameterType;
import com.google.auto.value.AutoValue;
Expand Down Expand Up @@ -99,23 +98,8 @@ public Builder setArrayValues(List<QueryParameterValue> arrayValues) {
/** Sets the data type of the array elements. The type must set to ARRAY. */
public abstract Builder setArrayType(StandardSQLTypeName arrayType);

abstract QueryParameterValue autoBuild();

/** Creates a {@code QueryParameterValue} object. */
public QueryParameterValue build() {
QueryParameterValue value = autoBuild();
boolean isArray = (value.getType() == StandardSQLTypeName.ARRAY);
checkArgument(
isArray == (value.getArrayType() != null),
"arrayType must be set if and only if the type is ARRAY");
checkArgument(
isArray == (value.getArrayValues() != null),
"arrayValues must be set if and only if the type is ARRAY");
checkArgument(
isArray == (value.getValue() == null),
"value must be set if and only if the type is not ARRAY");
return value;
}
public abstract QueryParameterValue build();
}

QueryParameterValue() {
Expand Down