@@ -120,25 +120,50 @@ static ValueType fromPb(com.google.api.LabelDescriptor.ValueType typePb) {
120
120
/**
121
121
* Returns the key associated to this label.
122
122
*/
123
+ @ Deprecated
123
124
public String key () {
124
125
return key ;
125
126
}
126
127
128
+ /**
129
+ * Returns the key associated to this label.
130
+ */
131
+ public String getKey () {
132
+ return key ;
133
+ }
134
+
127
135
/**
128
136
* Returns the type of data that can be assigned to this label.
129
137
*/
138
+ @ Deprecated
130
139
public ValueType valueType () {
131
140
return valueType ;
132
141
}
133
142
143
+ /**
144
+ * Returns the type of data that can be assigned to this label.
145
+ */
146
+ public ValueType getValueType () {
147
+ return valueType ;
148
+ }
149
+
134
150
/**
135
151
* Returns the optional human-readable description for this label. If not set, this method
136
152
* returns {@code null}.
137
153
*/
154
+ @ Deprecated
138
155
public String description () {
139
156
return description ;
140
157
}
141
158
159
+ /**
160
+ * Returns the optional human-readable description for this label. If not set, this method
161
+ * returns {@code null}.
162
+ */
163
+ public String getDescription () {
164
+ return description ;
165
+ }
166
+
142
167
@ Override
143
168
public final int hashCode () {
144
169
return Objects .hash (key , valueType , description );
@@ -199,22 +224,22 @@ static class Builder {
199
224
this .type = type ;
200
225
}
201
226
202
- Builder name (String name ) {
227
+ Builder setName (String name ) {
203
228
this .name = name ;
204
229
return this ;
205
230
}
206
231
207
- Builder displayName (String displayName ) {
232
+ Builder setDisplayName (String displayName ) {
208
233
this .displayName = displayName ;
209
234
return this ;
210
235
}
211
236
212
- Builder description (String description ) {
237
+ Builder setDescription (String description ) {
213
238
this .description = description ;
214
239
return this ;
215
240
}
216
241
217
- Builder labels (List <LabelDescriptor > labels ) {
242
+ Builder setLabels (List <LabelDescriptor > labels ) {
218
243
this .labels = labels ;
219
244
return this ;
220
245
}
@@ -236,44 +261,91 @@ MonitoredResourceDescriptor build() {
236
261
* Returns the monitored resource type. For example, the type {@code cloudsql_database} represents
237
262
* databases in Google Cloud SQL.
238
263
*/
264
+ @ Deprecated
239
265
public String type () {
240
266
return type ;
241
267
}
242
268
269
+ /**
270
+ * Returns the monitored resource type. For example, the type {@code cloudsql_database} represents
271
+ * databases in Google Cloud SQL.
272
+ */
273
+ public String getType () {
274
+ return type ;
275
+ }
276
+
243
277
/**
244
278
* Returns an optional name for the monitored resource descriptor. If not set, this method returns
245
279
* {@code null}.
246
280
*/
281
+ @ Deprecated
247
282
public String name () {
248
283
return name ;
249
284
}
250
285
286
+ /**
287
+ * Returns an optional name for the monitored resource descriptor. If not set, this method returns
288
+ * {@code null}.
289
+ */
290
+ public String getName () {
291
+ return name ;
292
+ }
293
+
251
294
/**
252
295
* Returns an optional concise name for the monitored resource type. This value might be displayed
253
296
* in user interfaces. For example, {@code Google Cloud SQL Database}. If not set, this method
254
297
* returns {@code null}.
255
298
*/
299
+ @ Deprecated
256
300
public String displayName () {
257
301
return displayName ;
258
302
}
259
303
304
+ /**
305
+ * Returns an optional concise name for the monitored resource type. This value might be displayed
306
+ * in user interfaces. For example, {@code Google Cloud SQL Database}. If not set, this method
307
+ * returns {@code null}.
308
+ */
309
+ public String getDisplayName () {
310
+ return displayName ;
311
+ }
312
+
260
313
/**
261
314
* Returns an optional detailed description of the monitored resource type. This value might be
262
315
* used in documentation. If not set, this method returns {@code null}.
263
316
*/
317
+ @ Deprecated
264
318
public String description () {
265
319
return description ;
266
320
}
267
321
322
+ /**
323
+ * Returns an optional detailed description of the monitored resource type. This value might be
324
+ * used in documentation. If not set, this method returns {@code null}.
325
+ */
326
+ public String getDescription () {
327
+ return description ;
328
+ }
329
+
268
330
/**
269
331
* Returns a list of labels used to describe instances of this monitored resource type. For
270
332
* example, an individual Google Cloud SQL database is identified by values for the labels
271
333
* {@code database_id} and {@code region}.
272
334
*/
335
+ @ Deprecated
273
336
public List <LabelDescriptor > labels () {
274
337
return labels ;
275
338
}
276
339
340
+ /**
341
+ * Returns a list of labels used to describe instances of this monitored resource type. For
342
+ * example, an individual Google Cloud SQL database is identified by values for the labels
343
+ * {@code database_id} and {@code region}.
344
+ */
345
+ public List <LabelDescriptor > getLabels () {
346
+ return labels ;
347
+ }
348
+
277
349
@ Override
278
350
public final int hashCode () {
279
351
return Objects .hash (type , name , displayName , description , labels );
@@ -323,23 +395,24 @@ public com.google.api.MonitoredResourceDescriptor toPb() {
323
395
return builder .build ();
324
396
}
325
397
326
- static Builder builder (String type ) {
398
+ static Builder newBuilder (String type ) {
327
399
return new Builder (type );
328
400
}
329
401
330
402
public static MonitoredResourceDescriptor fromPb (
331
403
com .google .api .MonitoredResourceDescriptor descriptorPb ) {
332
- Builder builder = builder (descriptorPb .getType ());
404
+ Builder builder = newBuilder (descriptorPb .getType ());
333
405
if (descriptorPb .getName () != null && !descriptorPb .getName ().equals ("" )) {
334
- builder .name (descriptorPb .getName ());
406
+ builder .setName (descriptorPb .getName ());
335
407
}
336
408
if (descriptorPb .getDisplayName () != null && !descriptorPb .getDisplayName ().equals ("" )) {
337
- builder .displayName (descriptorPb .getDisplayName ());
409
+ builder .setDisplayName (descriptorPb .getDisplayName ());
338
410
}
339
411
if (descriptorPb .getDescription () != null && !descriptorPb .getDescription ().equals ("" )) {
340
- builder .description (descriptorPb .getDescription ());
412
+ builder .setDescription (descriptorPb .getDescription ());
341
413
}
342
- builder .labels (Lists .transform (descriptorPb .getLabelsList (), LabelDescriptor .FROM_PB_FUNCTION ));
414
+ builder .setLabels (Lists .transform (descriptorPb .getLabelsList (),
415
+ LabelDescriptor .FROM_PB_FUNCTION ));
343
416
return builder .build ();
344
417
}
345
418
}
0 commit comments