Skip to content

Commit fad6e56

Browse files
committed
Make deprecated methods call renamed ones
1 parent ab64fc6 commit fad6e56

14 files changed

Lines changed: 163 additions & 254 deletions

File tree

google-cloud-examples/src/test/java/com/google/cloud/examples/storage/snippets/ITBucketSnippets.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public void testBucket() throws InterruptedException {
8686
Bucket bucket = bucketSnippets.reload();
8787
assertNotNull(bucket);
8888
Bucket updatedBucket = bucketSnippets.update();
89-
assertTrue(updatedBucket.getVersioningEnabled());
89+
assertTrue(updatedBucket.versioningEnabled());
9090
Blob blob1 = bucketSnippets.createBlobFromByteArray(BLOB1);
9191
assertNotNull(blob1);
9292
Blob blob2 = bucketSnippets.createBlobFromByteArrayWithContentType(BLOB2);

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

Lines changed: 20 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,7 @@ private Builder(Acl acl) {
8686
*/
8787
@Deprecated
8888
public Builder entity(Entity entity) {
89-
this.entity = entity;
90-
return this;
89+
return setEntity(entity);
9190
}
9291

9392
/**
@@ -103,8 +102,7 @@ public Builder setEntity(Entity entity) {
103102
*/
104103
@Deprecated
105104
public Builder role(Role role) {
106-
this.role = role;
107-
return this;
105+
return setRole(role);
108106
}
109107

110108
/**
@@ -115,23 +113,11 @@ public Builder setRole(Role role) {
115113
return this;
116114
}
117115

118-
@Deprecated
119-
Builder id(String id) {
120-
this.id = id;
121-
return this;
122-
}
123-
124116
Builder setId(String id) {
125117
this.id = id;
126118
return this;
127119
}
128120

129-
@Deprecated
130-
Builder etag(String etag) {
131-
this.etag = etag;
132-
return this;
133-
}
134-
135121
Builder setEtag(String etag) {
136122
this.etag = etag;
137123
return this;
@@ -169,7 +155,7 @@ public enum Type {
169155
*/
170156
@Deprecated
171157
public Type type() {
172-
return type;
158+
return getType();
173159
}
174160

175161
/**
@@ -184,7 +170,7 @@ public Type getType() {
184170
*/
185171
@Deprecated
186172
protected String value() {
187-
return value;
173+
return getValue();
188174
}
189175

190176
/**
@@ -267,7 +253,7 @@ public Domain(String domain) {
267253
*/
268254
@Deprecated
269255
public String domain() {
270-
return getValue();
256+
return getDomain();
271257
}
272258

273259
/**
@@ -299,7 +285,7 @@ public Group(String email) {
299285
*/
300286
@Deprecated
301287
public String email() {
302-
return getValue();
288+
return getEmail();
303289
}
304290

305291
/**
@@ -333,7 +319,7 @@ public User(String email) {
333319
*/
334320
@Deprecated
335321
public String email() {
336-
return getValue();
322+
return getEmail();
337323
}
338324

339325
/**
@@ -396,22 +382,22 @@ public Project(ProjectRole projectRole, String projectId) {
396382
*/
397383
@Deprecated
398384
public ProjectRole projectRole() {
399-
return projectRole;
385+
return getProjectRole();
400386
}
401387

402388
/**
403-
* Returns the project id for this entity.
389+
* Returns the role in the project for this entity.
404390
*/
405-
@Deprecated
406-
public String projectId() {
407-
return projectId;
391+
public ProjectRole getProjectRole() {
392+
return projectRole;
408393
}
409394

410395
/**
411-
* Returns the role in the project for this entity.
396+
* Returns the project id for this entity.
412397
*/
413-
public ProjectRole getProjectRole() {
414-
return projectRole;
398+
@Deprecated
399+
public String projectId() {
400+
return getProjectId();
415401
}
416402

417403
/**
@@ -448,7 +434,7 @@ private Acl(Builder builder) {
448434
*/
449435
@Deprecated
450436
public Entity entity() {
451-
return entity;
437+
return getEntity();
452438
}
453439

454440
/**
@@ -463,7 +449,7 @@ public Entity getEntity() {
463449
*/
464450
@Deprecated
465451
public Role role() {
466-
return role;
452+
return getRole();
467453
}
468454

469455
/**
@@ -478,7 +464,7 @@ public Role getRole() {
478464
*/
479465
@Deprecated
480466
public String id() {
481-
return id;
467+
return getId();
482468
}
483469

484470
/**
@@ -495,7 +481,7 @@ public String getId() {
495481
*/
496482
@Deprecated
497483
public String etag() {
498-
return etag;
484+
return getEtag();
499485
}
500486

501487
/**
@@ -532,7 +518,7 @@ public static Acl of(Entity entity, Role role) {
532518
*/
533519
@Deprecated
534520
public static Builder builder(Entity entity, Role role) {
535-
return new Builder(entity, role);
521+
return newBuilder(entity, role);
536522
}
537523

538524
/**

google-cloud-storage/src/main/java/com/google/cloud/storage/Blob.java

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,7 @@ public static class Builder extends BlobInfo.Builder {
206206
@Override
207207
@Deprecated
208208
public Builder blobId(BlobId blobId) {
209-
infoBuilder.setBlobId(blobId);
210-
return this;
209+
return setBlobId(blobId);
211210
}
212211

213212
@Override
@@ -223,10 +222,8 @@ Builder setGeneratedId(String generatedId) {
223222
}
224223

225224
@Override
226-
@Deprecated
227225
public Builder contentType(String contentType) {
228-
infoBuilder.setContentType(contentType);
229-
return this;
226+
return setContentType(contentType);
230227
}
231228

232229
@Override
@@ -238,8 +235,7 @@ public Builder setContentType(String contentType) {
238235
@Override
239236
@Deprecated
240237
public Builder contentDisposition(String contentDisposition) {
241-
infoBuilder.setContentDisposition(contentDisposition);
242-
return this;
238+
return setContentDisposition(contentDisposition);
243239
}
244240

245241
@Override
@@ -251,8 +247,7 @@ public Builder setContentDisposition(String contentDisposition) {
251247
@Override
252248
@Deprecated
253249
public Builder contentLanguage(String contentLanguage) {
254-
infoBuilder.setContentLanguage(contentLanguage);
255-
return this;
250+
return setContentLanguage(contentLanguage);
256251
}
257252

258253
@Override
@@ -264,8 +259,7 @@ public Builder setContentLanguage(String contentLanguage) {
264259
@Override
265260
@Deprecated
266261
public Builder contentEncoding(String contentEncoding) {
267-
infoBuilder.setContentEncoding(contentEncoding);
268-
return this;
262+
return setContentEncoding(contentEncoding);
269263
}
270264

271265
@Override
@@ -283,8 +277,7 @@ Builder setComponentCount(Integer componentCount) {
283277
@Override
284278
@Deprecated
285279
public Builder cacheControl(String cacheControl) {
286-
infoBuilder.setCacheControl(cacheControl);
287-
return this;
280+
return setCacheControl(cacheControl);
288281
}
289282

290283
@Override
@@ -296,8 +289,7 @@ public Builder setCacheControl(String cacheControl) {
296289
@Override
297290
@Deprecated
298291
public Builder acl(List<Acl> acl) {
299-
infoBuilder.setAcl(acl);
300-
return this;
292+
return setAcl(acl);
301293
}
302294

303295
@Override
@@ -333,8 +325,7 @@ Builder setSelfLink(String selfLink) {
333325
@Override
334326
@Deprecated
335327
public Builder md5(String md5) {
336-
infoBuilder.setMd5(md5);
337-
return this;
328+
return setMd5(md5);
338329
}
339330

340331
@Override
@@ -346,8 +337,7 @@ public Builder setMd5(String md5) {
346337
@Override
347338
@Deprecated
348339
public Builder crc32c(String crc32c) {
349-
infoBuilder.setCrc32c(crc32c);
350-
return this;
340+
return setCrc32c(crc32c);
351341
}
352342

353343
@Override
@@ -365,8 +355,7 @@ Builder setMediaLink(String mediaLink) {
365355
@Override
366356
@Deprecated
367357
public Builder metadata(Map<String, String> metadata) {
368-
infoBuilder.setMetadata(metadata);
369-
return this;
358+
return setMetadata(metadata);
370359
}
371360

372361
@Override
@@ -801,7 +790,7 @@ public List<Acl> listAcls() {
801790
*/
802791
@Deprecated
803792
public Storage storage() {
804-
return storage;
793+
return getStorage();
805794
}
806795

807796
/**

google-cloud-storage/src/main/java/com/google/cloud/storage/BlobId.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ private BlobId(String bucket, String name, Long generation) {
4747
*/
4848
@Deprecated
4949
public String bucket() {
50-
return bucket;
50+
return getBucket();
5151
}
5252

5353
/**
@@ -62,7 +62,7 @@ public String getBucket() {
6262
*/
6363
@Deprecated
6464
public String name() {
65-
return name;
65+
return getName();
6666
}
6767

6868
/**
@@ -77,7 +77,7 @@ public String getName() {
7777
*/
7878
@Deprecated
7979
public Long generation() {
80-
return generation;
80+
return getGeneration();
8181
}
8282

8383
/**

0 commit comments

Comments
 (0)