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 b29a55d
Showing 1 changed file with 6 additions and 7 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 baseTableId baseTableId or {@code null} for none
*/
public abstract Builder setBaseTable(TableReference tableReference);
public abstract Builder setBaseTableId(TableId baseTableId);

/** 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 getBaseTableId();

com.google.api.services.bigquery.model.IndexUnusedReason toPb() {
com.google.api.services.bigquery.model.IndexUnusedReason indexUnusedReason =
Expand All @@ -110,8 +109,8 @@ com.google.api.services.bigquery.model.IndexUnusedReason toPb() {
if (getMessage() != null) {
indexUnusedReason.setMessage(indexUnusedReason.getMessage());
}
if (getBaseTable() != null) {
indexUnusedReason.setBaseTable(indexUnusedReason.getBaseTable());
if (getBaseTableId() != null) {
indexUnusedReason.setBaseTable(getBaseTableId().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.setBaseTableId(TableId.fromPb(indexUnusedReason.getBaseTable()));
}
return builder.build();
}
Expand Down

0 comments on commit b29a55d

Please sign in to comment.