From 4b6e1cbe806eb88607fb955efa32eaa50e6aab43 Mon Sep 17 00:00:00 2001 From: Michael Darakananda Date: Tue, 8 May 2018 11:54:06 -0700 Subject: [PATCH] bigquery: let users contruct TableResult for testing (#3242) Fixes #3228. --- .../main/java/com/google/cloud/bigquery/TableResult.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableResult.java b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableResult.java index fd5e653798d6..a7be10d7d2ad 100644 --- a/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableResult.java +++ b/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/TableResult.java @@ -18,6 +18,7 @@ import static com.google.common.base.Preconditions.checkNotNull; +import com.google.api.core.InternalApi; import com.google.api.gax.paging.Page; import com.google.common.base.Function; import com.google.common.base.MoreObjects; @@ -35,7 +36,12 @@ public class TableResult implements Page, Serializable { private final long totalRows; private final Page pageNoSchema; - TableResult(Schema schema, long totalRows, Page pageNoSchema) { + /** + * If {@code schema} is non-null, {@code TableResult} adds the schema to {@code FieldValueList}s + * when iterating through them. {@code pageNoSchema} must not be null. + */ + @InternalApi("Exposed for testing") + public TableResult(Schema schema, long totalRows, Page pageNoSchema) { this.schema = schema; this.totalRows = totalRows; this.pageNoSchema = checkNotNull(pageNoSchema);