Class Metric.Builder (2.25.1)

public static final class Metric.Builder extends GeneratedMessageV3.Builder<Metric.Builder> implements MetricOrBuilder

A specific metric, identified by specifying values for all of the labels of a MetricDescriptor.

Protobuf type google.api.Metric

Implements

MetricOrBuilder

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public Metric.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
Metric.Builder
Overrides

build()

public Metric build()
Returns
TypeDescription
Metric

buildPartial()

public Metric buildPartial()
Returns
TypeDescription
Metric

clear()

public Metric.Builder clear()
Returns
TypeDescription
Metric.Builder
Overrides

clearField(Descriptors.FieldDescriptor field)

public Metric.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
Metric.Builder
Overrides

clearLabels()

public Metric.Builder clearLabels()
Returns
TypeDescription
Metric.Builder

clearOneof(Descriptors.OneofDescriptor oneof)

public Metric.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
Metric.Builder
Overrides

clearType()

public Metric.Builder clearType()

An existing metric type, see google.api.MetricDescriptor. For example, custom.googleapis.com/invoice/paid/amount.

string type = 3;

Returns
TypeDescription
Metric.Builder

This builder for chaining.

clone()

public Metric.Builder clone()
Returns
TypeDescription
Metric.Builder
Overrides

containsLabels(String key)

public boolean containsLabels(String key)

The set of label values that uniquely identify this metric. All labels listed in the MetricDescriptor must be assigned values.

map<string, string> labels = 2;

Parameter
NameDescription
keyString
Returns
TypeDescription
boolean

getDefaultInstanceForType()

public Metric getDefaultInstanceForType()
Returns
TypeDescription
Metric

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getLabels()

public Map<String,String> getLabels()

Use #getLabelsMap() instead.

Returns
TypeDescription
Map<String,String>

getLabelsCount()

public int getLabelsCount()

The set of label values that uniquely identify this metric. All labels listed in the MetricDescriptor must be assigned values.

map<string, string> labels = 2;

Returns
TypeDescription
int

getLabelsMap()

public Map<String,String> getLabelsMap()

The set of label values that uniquely identify this metric. All labels listed in the MetricDescriptor must be assigned values.

map<string, string> labels = 2;

Returns
TypeDescription
Map<String,String>

getLabelsOrDefault(String key, String defaultValue)

public String getLabelsOrDefault(String key, String defaultValue)

The set of label values that uniquely identify this metric. All labels listed in the MetricDescriptor must be assigned values.

map<string, string> labels = 2;

Parameters
NameDescription
keyString
defaultValueString
Returns
TypeDescription
String

getLabelsOrThrow(String key)

public String getLabelsOrThrow(String key)

The set of label values that uniquely identify this metric. All labels listed in the MetricDescriptor must be assigned values.

map<string, string> labels = 2;

Parameter
NameDescription
keyString
Returns
TypeDescription
String

getMutableLabels()

public Map<String,String> getMutableLabels()

Use alternate mutation accessors instead.

Returns
TypeDescription
Map<String,String>

getType()

public String getType()

An existing metric type, see google.api.MetricDescriptor. For example, custom.googleapis.com/invoice/paid/amount.

string type = 3;

Returns
TypeDescription
String

The type.

getTypeBytes()

public ByteString getTypeBytes()

An existing metric type, see google.api.MetricDescriptor. For example, custom.googleapis.com/invoice/paid/amount.

string type = 3;

Returns
TypeDescription
ByteString

The bytes for type.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

internalGetMapField(int number)

protected MapField internalGetMapField(int number)
Parameter
NameDescription
numberint
Returns
TypeDescription
MapField
Overrides

internalGetMutableMapField(int number)

protected MapField internalGetMutableMapField(int number)
Parameter
NameDescription
numberint
Returns
TypeDescription
MapField
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(Metric other)

public Metric.Builder mergeFrom(Metric other)
Parameter
NameDescription
otherMetric
Returns
TypeDescription
Metric.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public Metric.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Metric.Builder
Overrides
Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public Metric.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
Metric.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final Metric.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
Metric.Builder
Overrides

putAllLabels(Map<String,String> values)

public Metric.Builder putAllLabels(Map<String,String> values)

The set of label values that uniquely identify this metric. All labels listed in the MetricDescriptor must be assigned values.

map<string, string> labels = 2;

Parameter
NameDescription
valuesMap<String,String>
Returns
TypeDescription
Metric.Builder

putLabels(String key, String value)

public Metric.Builder putLabels(String key, String value)

The set of label values that uniquely identify this metric. All labels listed in the MetricDescriptor must be assigned values.

map<string, string> labels = 2;

Parameters
NameDescription
keyString
valueString
Returns
TypeDescription
Metric.Builder

removeLabels(String key)

public Metric.Builder removeLabels(String key)

The set of label values that uniquely identify this metric. All labels listed in the MetricDescriptor must be assigned values.

map<string, string> labels = 2;

Parameter
NameDescription
keyString
Returns
TypeDescription
Metric.Builder

setField(Descriptors.FieldDescriptor field, Object value)

public Metric.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
Metric.Builder
Overrides

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public Metric.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
Metric.Builder
Overrides

setType(String value)

public Metric.Builder setType(String value)

An existing metric type, see google.api.MetricDescriptor. For example, custom.googleapis.com/invoice/paid/amount.

string type = 3;

Parameter
NameDescription
valueString

The type to set.

Returns
TypeDescription
Metric.Builder

This builder for chaining.

setTypeBytes(ByteString value)

public Metric.Builder setTypeBytes(ByteString value)

An existing metric type, see google.api.MetricDescriptor. For example, custom.googleapis.com/invoice/paid/amount.

string type = 3;

Parameter
NameDescription
valueByteString

The bytes for type to set.

Returns
TypeDescription
Metric.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final Metric.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
Metric.Builder
Overrides