File tree Expand file tree Collapse file tree
gcloud-java-bigquery/src/main/java/com/google/gcloud/bigquery Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2121import com .google .api .services .bigquery .model .Table ;
2222import com .google .common .base .MoreObjects .ToStringHelper ;
2323
24+ import java .util .Objects ;
25+
2426/**
2527 * Google BigQuery External Table information. BigQuery's external tables are tables whose data
2628 * reside outside of BigQuery but can be queried as normal BigQuery tables. External tables are
@@ -103,6 +105,17 @@ ToStringHelper toStringHelper() {
103105 return super .toStringHelper ().add ("configuration" , configuration );
104106 }
105107
108+ @ Override
109+ public boolean equals (Object obj ) {
110+ return obj instanceof ExternalTableInfo
111+ && Objects .equals (toPb (), ((ExternalTableInfo ) obj ).toPb ());
112+ }
113+
114+ @ Override
115+ public int hashCode () {
116+ return Objects .hash (super .hashCode (), configuration );
117+ }
118+
106119 @ Override
107120 Table toPb () {
108121 Table tablePb = super .toPb ();
Original file line number Diff line number Diff line change @@ -213,6 +213,16 @@ ToStringHelper toStringHelper() {
213213 .add ("streamingBuffer" , streamingBuffer );
214214 }
215215
216+ @ Override
217+ public boolean equals (Object obj ) {
218+ return obj instanceof TableInfo && Objects .equals (toPb (), ((TableInfo ) obj ).toPb ());
219+ }
220+
221+ @ Override
222+ public int hashCode () {
223+ return Objects .hash (super .hashCode (), location , streamingBuffer );
224+ }
225+
216226 @ Override
217227 Table toPb () {
218228 Table tablePb = super .toPb ();
Original file line number Diff line number Diff line change 2525import com .google .common .collect .Lists ;
2626
2727import java .util .List ;
28+ import java .util .Objects ;
2829
2930/**
3031 * Google BigQuery View Table information. BigQuery's views are logical views, not materialized
@@ -143,6 +144,16 @@ ToStringHelper toStringHelper() {
143144 .add ("userDefinedFunctions" , userDefinedFunctions );
144145 }
145146
147+ @ Override
148+ public boolean equals (Object obj ) {
149+ return obj instanceof ViewInfo && Objects .equals (toPb (), ((ViewInfo ) obj ).toPb ());
150+ }
151+
152+ @ Override
153+ public int hashCode () {
154+ return Objects .hash (super .hashCode (), query , userDefinedFunctions );
155+ }
156+
146157 @ Override
147158 Table toPb () {
148159 Table tablePb = super .toPb ();
You can’t perform that action at this time.
0 commit comments