@SuppressWarnings({"rawtypes"}) @java.lang.Override protected com.google.protobuf.MapField internalGetMapField(int number) { switch (number) { case 5: return internalGetLabels(); case 8: return internalGetUserLabels(); default: throw new RuntimeException("Invalid map field number: " + number); } }
public int getUserLabelsCount() { return internalGetUserLabels().getMap().size(); } /**
/** * * * <pre> * User-supplied key/value data that does not need to conform to * the corresponding `NotificationChannelDescriptor`'s schema, unlike * the `labels` field. This field is intended to be used for organizing * and identifying the `NotificationChannel` objects. * The field can contain up to 64 entries. Each key and value is limited to * 63 Unicode characters or 128 bytes, whichever is smaller. Labels and * values can contain only lowercase letters, numerals, underscores, and * dashes. Keys must begin with a letter. * </pre> * * <code>map<string, string> user_labels = 8;</code> */ public java.util.Map<java.lang.String, java.lang.String> getUserLabelsMap() { return internalGetUserLabels().getMap(); } /**
/** * * * <pre> * User-supplied key/value data that does not need to conform to * the corresponding `NotificationChannelDescriptor`'s schema, unlike * the `labels` field. This field is intended to be used for organizing * and identifying the `NotificationChannel` objects. * The field can contain up to 64 entries. Each key and value is limited to * 63 Unicode characters or 128 bytes, whichever is smaller. Labels and * values can contain only lowercase letters, numerals, underscores, and * dashes. Keys must begin with a letter. * </pre> * * <code>map<string, string> user_labels = 8;</code> */ public java.lang.String getUserLabelsOrThrow(java.lang.String key) { if (key == null) { throw new java.lang.NullPointerException(); } java.util.Map<java.lang.String, java.lang.String> map = internalGetUserLabels().getMap(); if (!map.containsKey(key)) { throw new java.lang.IllegalArgumentException(); } return map.get(key); }
/** * * * <pre> * User-supplied key/value data that does not need to conform to * the corresponding `NotificationChannelDescriptor`'s schema, unlike * the `labels` field. This field is intended to be used for organizing * and identifying the `NotificationChannel` objects. * The field can contain up to 64 entries. Each key and value is limited to * 63 Unicode characters or 128 bytes, whichever is smaller. Labels and * values can contain only lowercase letters, numerals, underscores, and * dashes. Keys must begin with a letter. * </pre> * * <code>map<string, string> user_labels = 8;</code> */ public java.lang.String getUserLabelsOrDefault( 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 = internalGetUserLabels().getMap(); return map.containsKey(key) ? map.get(key) : defaultValue; } /**
/** * * * <pre> * User-supplied key/value data that does not need to conform to * the corresponding `NotificationChannelDescriptor`'s schema, unlike * the `labels` field. This field is intended to be used for organizing * and identifying the `NotificationChannel` objects. * The field can contain up to 64 entries. Each key and value is limited to * 63 Unicode characters or 128 bytes, whichever is smaller. Labels and * values can contain only lowercase letters, numerals, underscores, and * dashes. Keys must begin with a letter. * </pre> * * <code>map<string, string> user_labels = 8;</code> */ public boolean containsUserLabels(java.lang.String key) { if (key == null) { throw new java.lang.NullPointerException(); } return internalGetUserLabels().getMap().containsKey(key); } /** Use {@link #getUserLabelsMap()} instead. */
@java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (!getTypeBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, type_); } if (!getDisplayNameBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 3, displayName_); } if (!getDescriptionBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 4, description_); } com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 5); if (!getNameBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 6, name_); } com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( output, internalGetUserLabels(), UserLabelsDefaultEntryHolder.defaultEntry, 8); if (verificationStatus_ != com.google.monitoring.v3.NotificationChannel.VerificationStatus .VERIFICATION_STATUS_UNSPECIFIED.getNumber()) { output.writeEnum(9, verificationStatus_); } if (enabled_ != null) { output.writeMessage(11, getEnabled()); } unknownFields.writeTo(output); }
internalGetUserLabels().getMap().entrySet()) { com.google.protobuf.MapEntry<java.lang.String, java.lang.String> userLabels__ = UserLabelsDefaultEntryHolder.defaultEntry
hash = (53 * hash) + internalGetLabels().hashCode(); if (!internalGetUserLabels().getMap().isEmpty()) { hash = (37 * hash) + USER_LABELS_FIELD_NUMBER; hash = (53 * hash) + internalGetUserLabels().hashCode();
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.monitoring.v3.NotificationChannel)) { return super.equals(obj); } com.google.monitoring.v3.NotificationChannel other = (com.google.monitoring.v3.NotificationChannel) obj; boolean result = true; result = result && getType().equals(other.getType()); result = result && getName().equals(other.getName()); result = result && getDisplayName().equals(other.getDisplayName()); result = result && getDescription().equals(other.getDescription()); result = result && internalGetLabels().equals(other.internalGetLabels()); result = result && internalGetUserLabels().equals(other.internalGetUserLabels()); result = result && verificationStatus_ == other.verificationStatus_; result = result && (hasEnabled() == other.hasEnabled()); if (hasEnabled()) { result = result && getEnabled().equals(other.getEnabled()); } result = result && unknownFields.equals(other.unknownFields); return result; }