/** * <pre> * The set of label values that uniquely identify this metric. All * labels listed in the `MetricDescriptor` must be assigned values. * </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> * The set of label values that uniquely identify this metric. All * labels listed in the `MetricDescriptor` must be assigned values. * </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; } /**
@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> * The set of label values that uniquely identify this metric. All * labels listed in the `MetricDescriptor` must be assigned values. * </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); } /**
public int getLabelsCount() { return internalGetLabels().getMap().size(); } /**
public com.google.api.Metric buildPartial() { com.google.api.Metric result = new com.google.api.Metric(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; }
/** * <pre> * The set of label values that uniquely identify this metric. All * labels listed in the `MetricDescriptor` must be assigned values. * </pre> * * <code>map<string, string> labels = 2;</code> */ public java.util.Map<java.lang.String, java.lang.String> getLabelsMap() { return internalGetLabels().getMap(); } /**