Class Metric.Builder (2.40.0)

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
Type Description
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public Metric.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
Metric.Builder
Overrides

build()

public Metric build()
Returns
Type Description
Metric

buildPartial()

public Metric buildPartial()
Returns
Type Description
Metric

clear()

public Metric.Builder clear()
Returns
Type Description
Metric.Builder
Overrides

clearField(Descriptors.FieldDescriptor field)

public Metric.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
Metric.Builder
Overrides

clearLabels()

public Metric.Builder clearLabels()
Returns
Type Description
Metric.Builder

clearOneof(Descriptors.OneofDescriptor oneof)

public Metric.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
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
Type Description
Metric.Builder

This builder for chaining.

clone()

public Metric.Builder clone()
Returns
Type Description
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
Name Description
key String
Returns
Type Description
boolean

getDefaultInstanceForType()

public Metric getDefaultInstanceForType()
Returns
Type Description
Metric

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getLabels() (deprecated)

public Map<String,String> getLabels()

Use #getLabelsMap() instead.

Returns
Type Description
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
Type Description
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
Type Description
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
Name Description
key String
defaultValue String
Returns
Type Description
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
Name Description
key String
Returns
Type Description
String

getMutableLabels() (deprecated)

public Map<String,String> getMutableLabels()

Use alternate mutation accessors instead.

Returns
Type Description
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
Type Description
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
Type Description
ByteString

The bytes for type.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

internalGetMapFieldReflection(int number)

protected MapFieldReflectionAccessor internalGetMapFieldReflection(int number)
Parameter
Name Description
number int
Returns
Type Description
com.google.protobuf.MapFieldReflectionAccessor
Overrides
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMapFieldReflection(int)

internalGetMutableMapFieldReflection(int number)

protected MapFieldReflectionAccessor internalGetMutableMapFieldReflection(int number)
Parameter
Name Description
number int
Returns
Type Description
com.google.protobuf.MapFieldReflectionAccessor
Overrides
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMutableMapFieldReflection(int)

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(Metric other)

public Metric.Builder mergeFrom(Metric other)
Parameter
Name Description
other Metric
Returns
Type Description
Metric.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public Metric.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Metric.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public Metric.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
Metric.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final Metric.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
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
Name Description
values Map<String,String>
Returns
Type Description
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
Name Description
key String
value String
Returns
Type Description
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
Name Description
key String
Returns
Type Description
Metric.Builder

setField(Descriptors.FieldDescriptor field, Object value)

public Metric.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
Metric.Builder
Overrides

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

public Metric.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
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
Name Description
value String

The type to set.

Returns
Type Description
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
Name Description
value ByteString

The bytes for type to set.

Returns
Type Description
Metric.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final Metric.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
Metric.Builder
Overrides