Skip to content

Commit cbc7054

Browse files
committed
Make deprecated methods call renamed ones
1 parent 8f0127a commit cbc7054

37 files changed

Lines changed: 324 additions & 446 deletions

google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Acl.java

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public enum Type {
8282

8383
@Deprecated
8484
public Type type() {
85-
return type;
85+
return getType();
8686
}
8787

8888
public Type getType() {
@@ -136,7 +136,7 @@ public Domain(String domain) {
136136
*/
137137
@Deprecated
138138
public String domain() {
139-
return domain;
139+
return getDomain();
140140
}
141141

142142
/**
@@ -155,13 +155,13 @@ public boolean equals(Object obj) {
155155
return false;
156156
}
157157
Domain domainEntity = (Domain) obj;
158-
return Objects.equals(type(), domainEntity.type())
159-
&& Objects.equals(domain, domainEntity.domain());
158+
return Objects.equals(getType(), domainEntity.getType())
159+
&& Objects.equals(domain, domainEntity.getDomain());
160160
}
161161

162162
@Override
163163
public int hashCode() {
164-
return Objects.hash(type(), domain);
164+
return Objects.hash(getType(), domain);
165165
}
166166

167167
@Override
@@ -208,7 +208,7 @@ public Group(String identifier) {
208208
*/
209209
@Deprecated
210210
public String identifier() {
211-
return identifier;
211+
return getIdentifier();
212212
}
213213

214214
/**
@@ -229,12 +229,13 @@ public boolean equals(Object obj) {
229229
return false;
230230
}
231231
Group group = (Group) obj;
232-
return Objects.equals(type(), group.type()) && Objects.equals(identifier, group.identifier);
232+
return Objects.equals(getType(), group.getType())
233+
&& Objects.equals(identifier, group.identifier);
233234
}
234235

235236
@Override
236237
public int hashCode() {
237-
return Objects.hash(type(), identifier);
238+
return Objects.hash(getType(), identifier);
238239
}
239240

240241
@Override
@@ -310,7 +311,7 @@ public User(String email) {
310311
*/
311312
@Deprecated
312313
public String email() {
313-
return email;
314+
return getEmail();
314315
}
315316

316317
/**
@@ -329,12 +330,12 @@ public boolean equals(Object obj) {
329330
return false;
330331
}
331332
User user = (User) obj;
332-
return Objects.equals(type(), user.type()) && Objects.equals(email, user.email);
333+
return Objects.equals(getType(), user.getType()) && Objects.equals(email, user.email);
333334
}
334335

335336
@Override
336337
public int hashCode() {
337-
return Objects.hash(type(), email);
338+
return Objects.hash(getType(), email);
338339
}
339340

340341
@Override
@@ -373,7 +374,7 @@ public View(TableId id) {
373374
*/
374375
@Deprecated
375376
public TableId id() {
376-
return id;
377+
return getId();
377378
}
378379

379380
/**
@@ -392,12 +393,12 @@ public boolean equals(Object obj) {
392393
return false;
393394
}
394395
View view = (View) obj;
395-
return Objects.equals(type(), view.type()) && Objects.equals(id, view.id);
396+
return Objects.equals(getType(), view.getType()) && Objects.equals(id, view.id);
396397
}
397398

398399
@Override
399400
public int hashCode() {
400-
return Objects.hash(type(), id);
401+
return Objects.hash(getType(), id);
401402
}
402403

403404
@Override
@@ -421,7 +422,7 @@ private Acl(Entity entity, Role role) {
421422
*/
422423
@Deprecated
423424
public Entity entity() {
424-
return entity;
425+
return getEntity();
425426
}
426427

427428
/**
@@ -436,7 +437,7 @@ public Entity getEntity() {
436437
*/
437438
@Deprecated
438439
public Role role() {
439-
return role;
440+
return getRole();
440441
}
441442

442443
/**

google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryError.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public BigQueryError(String reason, String location, String message) {
7878
*/
7979
@Deprecated
8080
public String reason() {
81-
return reason;
81+
return getReason();
8282
}
8383

8484
/**
@@ -96,7 +96,7 @@ public String getReason() {
9696
*/
9797
@Deprecated
9898
public String location() {
99-
return location;
99+
return getLocation();
100100
}
101101

102102
/**
@@ -115,7 +115,7 @@ String getDebugInfo() {
115115
*/
116116
@Deprecated
117117
public String message() {
118-
return message;
118+
return getMessage();
119119
}
120120

121121
/**

google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/BigQueryException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public BigQueryException(IOException exception) {
7272
*/
7373
@Deprecated
7474
public BigQueryError error() {
75-
return error;
75+
return getError();
7676
}
7777

7878
/**

google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/CopyJobConfiguration.java

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,7 @@ private Builder(com.google.api.services.bigquery.model.JobConfiguration configur
8585
*/
8686
@Deprecated
8787
public Builder sourceTables(List<TableId> sourceTables) {
88-
this.sourceTables = sourceTables != null ? ImmutableList.copyOf(sourceTables) : null;
89-
return this;
88+
return setSourceTables(sourceTables);
9089
}
9190

9291
/**
@@ -102,8 +101,7 @@ public Builder setSourceTables(List<TableId> sourceTables) {
102101
*/
103102
@Deprecated
104103
public Builder destinationTable(TableId destinationTable) {
105-
this.destinationTable = destinationTable;
106-
return this;
104+
return setDestinationTable(destinationTable);
107105
}
108106

109107
/**
@@ -122,8 +120,7 @@ public Builder setDestinationTable(TableId destinationTable) {
122120
*/
123121
@Deprecated
124122
public Builder createDisposition(JobInfo.CreateDisposition createDisposition) {
125-
this.createDisposition = createDisposition;
126-
return this;
123+
return setCreateDisposition(createDisposition);
127124
}
128125

129126
/**
@@ -145,8 +142,7 @@ public Builder setCreateDisposition(JobInfo.CreateDisposition createDisposition)
145142
*/
146143
@Deprecated
147144
public Builder writeDisposition(JobInfo.WriteDisposition writeDisposition) {
148-
this.writeDisposition = writeDisposition;
149-
return this;
145+
return setWriteDisposition(writeDisposition);
150146
}
151147

152148
/**
@@ -178,7 +174,7 @@ private CopyJobConfiguration(Builder builder) {
178174
*/
179175
@Deprecated
180176
public List<TableId> sourceTables() {
181-
return sourceTables;
177+
return getSourceTables();
182178
}
183179

184180
/**
@@ -193,7 +189,7 @@ public List<TableId> getSourceTables() {
193189
*/
194190
@Deprecated
195191
public TableId destinationTable() {
196-
return destinationTable;
192+
return getDestinationTable();
197193
}
198194

199195
/**
@@ -211,7 +207,7 @@ public TableId getDestinationTable() {
211207
*/
212208
@Deprecated
213209
public JobInfo.CreateDisposition createDisposition() {
214-
return this.createDisposition;
210+
return this.getCreateDisposition();
215211
}
216212

217213
/**
@@ -232,7 +228,7 @@ public JobInfo.CreateDisposition getCreateDisposition() {
232228
*/
233229
@Deprecated
234230
public JobInfo.WriteDisposition writeDisposition() {
235-
return writeDisposition;
231+
return getWriteDisposition();
236232
}
237233

238234
/**
@@ -309,7 +305,7 @@ com.google.api.services.bigquery.model.JobConfiguration toPb() {
309305
*/
310306
@Deprecated
311307
public static Builder builder(TableId destinationTable, TableId sourceTable) {
312-
return newBuilder(destinationTable, ImmutableList.of(checkNotNull(sourceTable)));
308+
return newBuilder(destinationTable, sourceTable);
313309
}
314310

315311
/**
@@ -324,7 +320,7 @@ public static Builder newBuilder(TableId destinationTable, TableId sourceTable)
324320
*/
325321
@Deprecated
326322
public static Builder builder(TableId destinationTable, List<TableId> sourceTables) {
327-
return new Builder().setDestinationTable(destinationTable).setSourceTables(sourceTables);
323+
return newBuilder(destinationTable, sourceTables);
328324
}
329325

330326
/**

google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/CsvOptions.java

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,7 @@ private Builder(CsvOptions csvOptions) {
6565
*/
6666
@Deprecated
6767
public Builder allowJaggedRows(boolean allowJaggedRows) {
68-
this.allowJaggedRows = allowJaggedRows;
69-
return this;
68+
return setAllowJaggedRows(allowJaggedRows);
7069
}
7170

7271
/**
@@ -87,8 +86,7 @@ public Builder setAllowJaggedRows(boolean allowJaggedRows) {
8786
*/
8887
@Deprecated
8988
public Builder allowQuotedNewLines(boolean allowQuotedNewLines) {
90-
this.allowQuotedNewLines = allowQuotedNewLines;
91-
return this;
89+
return setAllowQuotedNewLines(allowQuotedNewLines);
9290
}
9391

9492
/**
@@ -107,8 +105,7 @@ public Builder setAllowQuotedNewLines(boolean allowQuotedNewLines) {
107105
*/
108106
@Deprecated
109107
public Builder encoding(String encoding) {
110-
this.encoding = encoding;
111-
return this;
108+
return setEncoding(encoding);
112109
}
113110

114111
/**
@@ -128,8 +125,7 @@ public Builder setEncoding(String encoding) {
128125
*/
129126
@Deprecated
130127
public Builder encoding(Charset encoding) {
131-
this.encoding = encoding.name();
132-
return this;
128+
return setEncoding(encoding);
133129
}
134130

135131
/**
@@ -150,8 +146,7 @@ public Builder setEncoding(Charset encoding) {
150146
*/
151147
@Deprecated
152148
public Builder fieldDelimiter(String fieldDelimiter) {
153-
this.fieldDelimiter = fieldDelimiter;
154-
return this;
149+
return setFieldDelimiter(fieldDelimiter);
155150
}
156151

157152
/**
@@ -175,8 +170,7 @@ public Builder setFieldDelimiter(String fieldDelimiter) {
175170
*/
176171
@Deprecated
177172
public Builder quote(String quote) {
178-
this.quote = quote;
179-
return this;
173+
return setQuote(quote);
180174
}
181175

182176
/**
@@ -199,8 +193,7 @@ public Builder setQuote(String quote) {
199193
*/
200194
@Deprecated
201195
public Builder skipLeadingRows(long skipLeadingRows) {
202-
this.skipLeadingRows = skipLeadingRows;
203-
return this;
196+
return setSkipLeadingRows(skipLeadingRows);
204197
}
205198

206199
/**
@@ -257,7 +250,7 @@ public Boolean allowQuotedNewLines() {
257250
*/
258251
@Deprecated
259252
public String encoding() {
260-
return encoding;
253+
return getEncoding();
261254
}
262255

263256
/**
@@ -274,7 +267,7 @@ public String getEncoding() {
274267
*/
275268
@Deprecated
276269
public String fieldDelimiter() {
277-
return fieldDelimiter;
270+
return getFieldDelimiter();
278271
}
279272

280273
/**
@@ -289,7 +282,7 @@ public String getFieldDelimiter() {
289282
*/
290283
@Deprecated
291284
public String quote() {
292-
return quote;
285+
return getQuote();
293286
}
294287

295288
/**
@@ -305,7 +298,7 @@ public String getQuote() {
305298
*/
306299
@Deprecated
307300
public Long skipLeadingRows() {
308-
return skipLeadingRows;
301+
return getSkipLeadingRows();
309302
}
310303

311304
/**
@@ -326,7 +319,7 @@ public Builder toBuilder() {
326319
@Override
327320
public String toString() {
328321
return MoreObjects.toStringHelper(this)
329-
.add("type", type())
322+
.add("type", getType())
330323
.add("allowJaggedRows", allowJaggedRows)
331324
.add("allowQuotedNewLines", allowQuotedNewLines)
332325
.add("encoding", encoding)
@@ -338,7 +331,7 @@ public String toString() {
338331

339332
@Override
340333
public int hashCode() {
341-
return Objects.hash(type(), allowJaggedRows, allowQuotedNewLines, encoding, fieldDelimiter,
334+
return Objects.hash(getType(), allowJaggedRows, allowQuotedNewLines, encoding, fieldDelimiter,
342335
quote, skipLeadingRows);
343336
}
344337

@@ -366,7 +359,7 @@ com.google.api.services.bigquery.model.CsvOptions toPb() {
366359
*/
367360
@Deprecated
368361
public static Builder builder() {
369-
return new Builder();
362+
return newBuilder();
370363
}
371364

372365
/**

0 commit comments

Comments
 (0)