@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); } } protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
/** * <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(); } /**
/** * <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.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); }
/** * <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; } /**
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.api.MonitoredResource)) { return super.equals(obj); } com.google.api.MonitoredResource other = (com.google.api.MonitoredResource) obj; boolean result = true; result = result && getType() .equals(other.getType()); result = result && internalGetLabels().equals( other.internalGetLabels()); return result; }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + TYPE_FIELD_NUMBER; hash = (53 * hash) + getType().hashCode(); if (!internalGetLabels().getMap().isEmpty()) { hash = (37 * hash) + LABELS_FIELD_NUMBER; hash = (53 * hash) + internalGetLabels().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (!getTypeBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, type_); } com.google.protobuf.GeneratedMessageV3 .serializeStringMapTo( output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 2); }
public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (!getTypeBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, type_); } for (java.util.Map.Entry<java.lang.String, java.lang.String> entry : internalGetLabels().getMap().entrySet()) { com.google.protobuf.MapEntry<java.lang.String, java.lang.String> labels__ = LabelsDefaultEntryHolder.defaultEntry.newBuilderForType() .setKey(entry.getKey()) .setValue(entry.getValue()) .build(); size += com.google.protobuf.CodedOutputStream .computeMessageSize(2, labels__); } memoizedSize = size; return size; }