Skip to content

Commit 925063c

Browse files
committed
Make deprecated methods call renamed ones
1 parent 1eb89be commit 925063c

12 files changed

Lines changed: 99 additions & 141 deletions

File tree

google-cloud-core/src/main/java/com/google/cloud/MonitoredResource.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,7 @@ public static class Builder {
6868
*/
6969
@Deprecated
7070
public Builder type(String type) {
71-
this.type = type;
72-
return this;
71+
return setType(type);
7372
}
7473

7574
/**
@@ -89,8 +88,7 @@ public Builder setType(String type) {
8988
*/
9089
@Deprecated
9190
public Builder labels(Map<String, String> labels) {
92-
this.labels = new HashMap<>(checkNotNull(labels));
93-
return this;
91+
return setLabels(labels);
9492
}
9593

9694
/**
@@ -136,7 +134,7 @@ public MonitoredResource build() {
136134
*/
137135
@Deprecated
138136
public String type() {
139-
return type;
137+
return getType();
140138
}
141139

142140
/**
@@ -155,7 +153,7 @@ public String getType() {
155153
*/
156154
@Deprecated
157155
public Map<String, String> labels() {
158-
return labels;
156+
return getLabels();
159157
}
160158

161159
/**
@@ -211,7 +209,7 @@ public Builder toBuilder() {
211209
*/
212210
@Deprecated
213211
public static Builder builder(String type) {
214-
return new Builder(type);
212+
return newBuilder(type);
215213
}
216214

217215
/**

google-cloud-core/src/main/java/com/google/cloud/MonitoredResourceDescriptor.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ static ValueType fromPb(com.google.api.LabelDescriptor.ValueType typePb) {
122122
*/
123123
@Deprecated
124124
public String key() {
125-
return key;
125+
return getKey();
126126
}
127127

128128
/**
@@ -137,7 +137,7 @@ public String getKey() {
137137
*/
138138
@Deprecated
139139
public ValueType valueType() {
140-
return valueType;
140+
return getValueType();
141141
}
142142

143143
/**
@@ -153,7 +153,7 @@ public ValueType getValueType() {
153153
*/
154154
@Deprecated
155155
public String description() {
156-
return description;
156+
return getDescription();
157157
}
158158

159159
/**
@@ -263,7 +263,7 @@ MonitoredResourceDescriptor build() {
263263
*/
264264
@Deprecated
265265
public String type() {
266-
return type;
266+
return getType();
267267
}
268268

269269
/**
@@ -280,7 +280,7 @@ public String getType() {
280280
*/
281281
@Deprecated
282282
public String name() {
283-
return name;
283+
return getName();
284284
}
285285

286286
/**
@@ -298,7 +298,7 @@ public String getName() {
298298
*/
299299
@Deprecated
300300
public String displayName() {
301-
return displayName;
301+
return getDisplayName();
302302
}
303303

304304
/**
@@ -316,7 +316,7 @@ public String getDisplayName() {
316316
*/
317317
@Deprecated
318318
public String description() {
319-
return description;
319+
return getDescription();
320320
}
321321

322322
/**
@@ -334,7 +334,7 @@ public String getDescription() {
334334
*/
335335
@Deprecated
336336
public List<LabelDescriptor> labels() {
337-
return labels;
337+
return getLabels();
338338
}
339339

340340
/**

google-cloud-logging/src/main/java/com/google/cloud/logging/HttpRequest.java

Lines changed: 24 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,7 @@ public static final class Builder {
9999
*/
100100
@Deprecated
101101
public Builder requestMethod(RequestMethod requestMethod) {
102-
this.requestMethod = requestMethod;
103-
return this;
102+
return setRequestMethod(requestMethod);
104103
}
105104

106105
/**
@@ -118,8 +117,7 @@ public Builder setRequestMethod(RequestMethod requestMethod) {
118117
*/
119118
@Deprecated
120119
public Builder requestUrl(String requestUrl) {
121-
this.requestUrl = requestUrl;
122-
return this;
120+
return setRequestUrl(requestUrl);
123121
}
124122

125123
/**
@@ -138,8 +136,7 @@ public Builder setRequestUrl(String requestUrl) {
138136
*/
139137
@Deprecated
140138
public Builder requestSize(long requestSize) {
141-
this.requestSize = requestSize;
142-
return this;
139+
return setRequestSize(requestSize);
143140
}
144141

145142
/**
@@ -156,8 +153,7 @@ public Builder setRequestSize(long requestSize) {
156153
*/
157154
@Deprecated
158155
public Builder status(int status) {
159-
this.status = status;
160-
return this;
156+
return setStatus(status);
161157
}
162158

163159
/**
@@ -174,8 +170,7 @@ public Builder setStatus(int status) {
174170
*/
175171
@Deprecated
176172
public Builder responseSize(long responseSize) {
177-
this.responseSize = responseSize;
178-
return this;
173+
return setResponseSize(responseSize);
179174
}
180175

181176
/**
@@ -193,8 +188,7 @@ public Builder setResponseSize(long responseSize) {
193188
*/
194189
@Deprecated
195190
public Builder userAgent(String userAgent) {
196-
this.userAgent = userAgent;
197-
return this;
191+
return setUserAgent(userAgent);
198192
}
199193

200194
/**
@@ -212,8 +206,7 @@ public Builder setUserAgent(String userAgent) {
212206
*/
213207
@Deprecated
214208
public Builder remoteIp(String remoteIp) {
215-
this.remoteIp = remoteIp;
216-
return this;
209+
return setRemoteIp(remoteIp);
217210
}
218211

219212
/**
@@ -231,8 +224,7 @@ public Builder setRemoteIp(String remoteIp) {
231224
*/
232225
@Deprecated
233226
public Builder serverIp(String serverIp) {
234-
this.serverIp = serverIp;
235-
return this;
227+
return setServerIp(serverIp);
236228
}
237229

238230
/**
@@ -252,8 +244,7 @@ public Builder setServerIp(String serverIp) {
252244
*/
253245
@Deprecated
254246
public Builder referer(String referer) {
255-
this.referer = referer;
256-
return this;
247+
return setReferer(referer);
257248
}
258249

259250
/**
@@ -272,8 +263,7 @@ public Builder setReferer(String referer) {
272263
*/
273264
@Deprecated
274265
public Builder cacheLookup(boolean cacheLookup) {
275-
this.cacheLookup = cacheLookup;
276-
return this;
266+
return setCacheLookup(cacheLookup);
277267
}
278268

279269
/**
@@ -290,8 +280,7 @@ public Builder setCacheLookup(boolean cacheLookup) {
290280
*/
291281
@Deprecated
292282
public Builder cacheHit(boolean cacheHit) {
293-
this.cacheHit = cacheHit;
294-
return this;
283+
return setCacheHit(cacheHit);
295284
}
296285

297286
/**
@@ -310,8 +299,7 @@ public Builder setCacheHit(boolean cacheHit) {
310299
*/
311300
@Deprecated
312301
public Builder cacheValidatedWithOriginServer(boolean cacheValidatedWithOriginServer) {
313-
this.cacheValidatedWithOriginServer = cacheValidatedWithOriginServer;
314-
return this;
302+
return setCacheValidatedWithOriginServer(cacheValidatedWithOriginServer);
315303
}
316304

317305
/**
@@ -330,8 +318,7 @@ public Builder setCacheValidatedWithOriginServer(boolean cacheValidatedWithOrigi
330318
*/
331319
@Deprecated
332320
public Builder cacheFillBytes(long cacheFillBytes) {
333-
this.cacheFillBytes = cacheFillBytes;
334-
return this;
321+
return setCacheFillBytes(cacheFillBytes);
335322
}
336323

337324
/**
@@ -372,7 +359,7 @@ public HttpRequest build() {
372359
*/
373360
@Deprecated
374361
public RequestMethod requestMethod() {
375-
return requestMethod;
362+
return getRequestMethod();
376363
}
377364

378365
/**
@@ -389,7 +376,7 @@ public RequestMethod getRequestMethod() {
389376
*/
390377
@Deprecated
391378
public String requestUrl() {
392-
return requestUrl;
379+
return getRequestUrl();
393380
}
394381

395382
/**
@@ -407,7 +394,7 @@ public String getRequestUrl() {
407394
*/
408395
@Deprecated
409396
public Long requestSize() {
410-
return requestSize;
397+
return getRequestSize();
411398
}
412399

413400
/**
@@ -423,7 +410,7 @@ public Long getRequestSize() {
423410
*/
424411
@Deprecated
425412
public Integer status() {
426-
return status;
413+
return getStatus();
427414
}
428415

429416
/**
@@ -439,7 +426,7 @@ public Integer getStatus() {
439426
*/
440427
@Deprecated
441428
public Long responseSize() {
442-
return responseSize;
429+
return getResponseSize();
443430
}
444431

445432
/**
@@ -456,7 +443,7 @@ public Long getResponseSize() {
456443
*/
457444
@Deprecated
458445
public String userAgent() {
459-
return userAgent;
446+
return getUserAgent();
460447
}
461448

462449
/**
@@ -473,7 +460,7 @@ public String getUserAgent() {
473460
*/
474461
@Deprecated
475462
public String remoteIp() {
476-
return remoteIp;
463+
return getRemoteIp();
477464
}
478465

479466
/**
@@ -490,7 +477,7 @@ public String getRemoteIp() {
490477
*/
491478
@Deprecated
492479
public String serverIp() {
493-
return serverIp;
480+
return getServerIp();
494481
}
495482

496483
/**
@@ -509,7 +496,7 @@ public String getServerIp() {
509496
*/
510497
@Deprecated
511498
public String referer() {
512-
return referer;
499+
return getReferer();
513500
}
514501

515502
/**
@@ -553,7 +540,7 @@ public boolean cacheValidatedWithOriginServer() {
553540
*/
554541
@Deprecated
555542
public Long cacheFillBytes() {
556-
return cacheFillBytes;
543+
return getCacheFillBytes();
557544
}
558545

559546
/**
@@ -665,7 +652,7 @@ com.google.logging.type.HttpRequest toPb() {
665652
*/
666653
@Deprecated
667654
public static Builder builder() {
668-
return new Builder();
655+
return newBuilder();
669656
}
670657

671658
/**

0 commit comments

Comments
 (0)