Class Metric.Builder (2.65.0)

public static final class Metric.Builder extends GeneratedMessage.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

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

clearLabels()

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

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.

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 GeneratedMessage.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.GeneratedMessage.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.GeneratedMessage.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

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

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.