@@ -120,22 +120,47 @@ static ValueType fromPb(com.google.api.LabelDescriptor.ValueType typePb) {
120120 /**
121121 * Returns the key associated to this label.
122122 */
123+ @ Deprecated
123124 public String key () {
125+ return getKey ();
126+ }
127+
128+ /**
129+ * Returns the key associated to this label.
130+ */
131+ public String getKey () {
124132 return key ;
125133 }
126134
127135 /**
128136 * Returns the type of data that can be assigned to this label.
129137 */
138+ @ Deprecated
130139 public ValueType valueType () {
140+ return getValueType ();
141+ }
142+
143+ /**
144+ * Returns the type of data that can be assigned to this label.
145+ */
146+ public ValueType getValueType () {
131147 return valueType ;
132148 }
133149
134150 /**
135151 * Returns the optional human-readable description for this label. If not set, this method
136152 * returns {@code null}.
137153 */
154+ @ Deprecated
138155 public String description () {
156+ return getDescription ();
157+ }
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 () {
139164 return description ;
140165 }
141166
@@ -199,22 +224,22 @@ static class Builder {
199224 this .type = type ;
200225 }
201226
202- Builder name (String name ) {
227+ Builder setName (String name ) {
203228 this .name = name ;
204229 return this ;
205230 }
206231
207- Builder displayName (String displayName ) {
232+ Builder setDisplayName (String displayName ) {
208233 this .displayName = displayName ;
209234 return this ;
210235 }
211236
212- Builder description (String description ) {
237+ Builder setDescription (String description ) {
213238 this .description = description ;
214239 return this ;
215240 }
216241
217- Builder labels (List <LabelDescriptor > labels ) {
242+ Builder setLabels (List <LabelDescriptor > labels ) {
218243 this .labels = labels ;
219244 return this ;
220245 }
@@ -236,15 +261,33 @@ MonitoredResourceDescriptor build() {
236261 * Returns the monitored resource type. For example, the type {@code cloudsql_database} represents
237262 * databases in Google Cloud SQL.
238263 */
264+ @ Deprecated
239265 public String type () {
266+ return getType ();
267+ }
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 () {
240274 return type ;
241275 }
242276
243277 /**
244278 * Returns an optional name for the monitored resource descriptor. If not set, this method returns
245279 * {@code null}.
246280 */
281+ @ Deprecated
247282 public String name () {
283+ return getName ();
284+ }
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 () {
248291 return name ;
249292 }
250293
@@ -253,15 +296,34 @@ public String name() {
253296 * in user interfaces. For example, {@code Google Cloud SQL Database}. If not set, this method
254297 * returns {@code null}.
255298 */
299+ @ Deprecated
256300 public String displayName () {
301+ return getDisplayName ();
302+ }
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 () {
257310 return displayName ;
258311 }
259312
260313 /**
261314 * Returns an optional detailed description of the monitored resource type. This value might be
262315 * used in documentation. If not set, this method returns {@code null}.
263316 */
317+ @ Deprecated
264318 public String description () {
319+ return getDescription ();
320+ }
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 () {
265327 return description ;
266328 }
267329
@@ -270,7 +332,17 @@ public String description() {
270332 * example, an individual Google Cloud SQL database is identified by values for the labels
271333 * {@code database_id} and {@code region}.
272334 */
335+ @ Deprecated
273336 public List <LabelDescriptor > labels () {
337+ return getLabels ();
338+ }
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 () {
274346 return labels ;
275347 }
276348
@@ -323,23 +395,24 @@ public com.google.api.MonitoredResourceDescriptor toPb() {
323395 return builder .build ();
324396 }
325397
326- static Builder builder (String type ) {
398+ static Builder newBuilder (String type ) {
327399 return new Builder (type );
328400 }
329401
330402 public static MonitoredResourceDescriptor fromPb (
331403 com .google .api .MonitoredResourceDescriptor descriptorPb ) {
332- Builder builder = builder (descriptorPb .getType ());
404+ Builder builder = newBuilder (descriptorPb .getType ());
333405 if (descriptorPb .getName () != null && !descriptorPb .getName ().equals ("" )) {
334- builder .name (descriptorPb .getName ());
406+ builder .setName (descriptorPb .getName ());
335407 }
336408 if (descriptorPb .getDisplayName () != null && !descriptorPb .getDisplayName ().equals ("" )) {
337- builder .displayName (descriptorPb .getDisplayName ());
409+ builder .setDisplayName (descriptorPb .getDisplayName ());
338410 }
339411 if (descriptorPb .getDescription () != null && !descriptorPb .getDescription ().equals ("" )) {
340- builder .description (descriptorPb .getDescription ());
412+ builder .setDescription (descriptorPb .getDescription ());
341413 }
342- builder .labels (Lists .transform (descriptorPb .getLabelsList (), LabelDescriptor .FROM_PB_FUNCTION ));
414+ builder .setLabels (Lists .transform (descriptorPb .getLabelsList (),
415+ LabelDescriptor .FROM_PB_FUNCTION ));
343416 return builder .build ();
344417 }
345418}
0 commit comments