Skip to content

Commit

Permalink
fix: hide TableReference data struct
Browse files Browse the repository at this point in the history
  • Loading branch information
farhan0102 committed Aug 18, 2023
1 parent f8e3da7 commit 0117626
Showing 1 changed file with 5 additions and 6 deletions.
Expand Up @@ -16,7 +16,6 @@

package com.google.cloud.bigquery;

import com.google.api.services.bigquery.model.TableReference;
import com.google.auto.value.AutoValue;
import java.io.Serializable;
import javax.annotation.Nullable;
Expand Down Expand Up @@ -52,9 +51,9 @@ public abstract static class Builder {
/**
* Specifies the base table involved in the reason that no search index was used.
*
* @param tableReference tableReference or {@code null} for none
* @param tableId tableId or {@code null} for none
*/
public abstract Builder setBaseTable(TableReference tableReference);
public abstract Builder setBaseTable(TableId tableId);

/** Creates a @code IndexUnusedReason} object. */
public abstract IndexUnusedReason build();
Expand Down Expand Up @@ -96,7 +95,7 @@ public static Builder newBuilder() {
* @return value or {@code null} for none
*/
@Nullable
public abstract TableReference getBaseTable();
public abstract TableId getBaseTable();

com.google.api.services.bigquery.model.IndexUnusedReason toPb() {
com.google.api.services.bigquery.model.IndexUnusedReason indexUnusedReason =
Expand All @@ -111,7 +110,7 @@ com.google.api.services.bigquery.model.IndexUnusedReason toPb() {
indexUnusedReason.setMessage(indexUnusedReason.getMessage());
}
if (getBaseTable() != null) {
indexUnusedReason.setBaseTable(indexUnusedReason.getBaseTable());
indexUnusedReason.setBaseTable(getBaseTable().toPb());
}
return indexUnusedReason;
}
Expand All @@ -129,7 +128,7 @@ static IndexUnusedReason fromPb(
builder.setMessage(indexUnusedReason.getMessage());
}
if (indexUnusedReason.getBaseTable() != null) {
builder.setBaseTable(indexUnusedReason.getBaseTable());
builder.setBaseTable(TableId.fromPb(indexUnusedReason.getBaseTable()));
}
return builder.build();
}
Expand Down

0 comments on commit 0117626

Please sign in to comment.