/** * <pre> * Required. Values for all of the labels listed in the associated monitored * resource descriptor. For example, Cloud SQL databases use the labels * `"database_id"` and `"zone"`. * </pre> * * <code>map<string, string> labels = 2;</code> */ public java.lang.String getLabelsOrThrow( java.lang.String key) { if (key == null) { throw new java.lang.NullPointerException(); } java.util.Map<java.lang.String, java.lang.String> map = internalGetLabels().getMap(); if (!map.containsKey(key)) { throw new java.lang.IllegalArgumentException(); } return map.get(key); }
@SuppressWarnings({"rawtypes"}) protected com.google.protobuf.MapField internalGetMapField( int number) { switch (number) { case 2: return internalGetLabels(); default: throw new RuntimeException( "Invalid map field number: " + number); } } @SuppressWarnings({"rawtypes"})
/** * <pre> * Required. Values for all of the labels listed in the associated monitored * resource descriptor. For example, Cloud SQL databases use the labels * `"database_id"` and `"zone"`. * </pre> * * <code>map<string, string> labels = 2;</code> */ public java.lang.String getLabelsOrDefault( java.lang.String key, java.lang.String defaultValue) { if (key == null) { throw new java.lang.NullPointerException(); } java.util.Map<java.lang.String, java.lang.String> map = internalGetLabels().getMap(); return map.containsKey(key) ? map.get(key) : defaultValue; } /**
/** * <pre> * Required. Values for all of the labels listed in the associated monitored * resource descriptor. For example, Cloud SQL databases use the labels * `"database_id"` and `"zone"`. * </pre> * * <code>map<string, string> labels = 2;</code> */ public boolean containsLabels( java.lang.String key) { if (key == null) { throw new java.lang.NullPointerException(); } return internalGetLabels().getMap().containsKey(key); } /**
/** * <pre> * Required. Values for all of the labels listed in the associated monitored * resource descriptor. For example, Cloud SQL databases use the labels * `"database_id"` and `"zone"`. * </pre> * * <code>map<string, string> labels = 2;</code> */ public java.util.Map<java.lang.String, java.lang.String> getLabelsMap() { return internalGetLabels().getMap(); } /**
public int getLabelsCount() { return internalGetLabels().getMap().size(); } /**
public com.google.api.MonitoredResource buildPartial() { com.google.api.MonitoredResource result = new com.google.api.MonitoredResource(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; result.type_ = type_; result.labels_ = internalGetLabels(); result.labels_.makeImmutable(); result.bitField0_ = to_bitField0_; onBuilt(); return result; }