Class Span.Attributes.Builder (2.83.0)

public static final class Span.Attributes.Builder extends GeneratedMessage.Builder<Span.Attributes.Builder> implements Span.AttributesOrBuilder

A set of attributes as key-value pairs.

Protobuf type google.devtools.cloudtrace.v2.Span.Attributes

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

Methods

build()

public Span.Attributes build()
Returns
Type Description
Span.Attributes

buildPartial()

public Span.Attributes buildPartial()
Returns
Type Description
Span.Attributes

clear()

public Span.Attributes.Builder clear()
Returns
Type Description
Span.Attributes.Builder
Overrides

clearAttributeMap()

public Span.Attributes.Builder clearAttributeMap()
Returns
Type Description
Span.Attributes.Builder

clearDroppedAttributesCount()

public Span.Attributes.Builder clearDroppedAttributesCount()

The number of attributes that were discarded. Attributes can be discarded because their keys are too long or because there are too many attributes. If this value is 0 then all attributes are valid.

int32 dropped_attributes_count = 2;

Returns
Type Description
Span.Attributes.Builder

This builder for chaining.

containsAttributeMap(String key)

public boolean containsAttributeMap(String key)

A set of attributes. Each attribute's key can be up to 128 bytes long. The value can be a string up to 256 bytes, a signed 64-bit integer, or the boolean values true or false. For example:

"/instance_id": { "string_value": { "value": "my-instance" } } "/http/request_bytes": { "int_value": 300 } "example.com/myattribute": { "bool_value": false }

map<string, .google.devtools.cloudtrace.v2.AttributeValue> attribute_map = 1;

Parameter
Name Description
key String
Returns
Type Description
boolean

getAttributeMap() (deprecated)

public Map<String,AttributeValue> getAttributeMap()

Use #getAttributeMapMap() instead.

Returns
Type Description
Map<String,AttributeValue>

getAttributeMapCount()

public int getAttributeMapCount()

A set of attributes. Each attribute's key can be up to 128 bytes long. The value can be a string up to 256 bytes, a signed 64-bit integer, or the boolean values true or false. For example:

"/instance_id": { "string_value": { "value": "my-instance" } } "/http/request_bytes": { "int_value": 300 } "example.com/myattribute": { "bool_value": false }

map<string, .google.devtools.cloudtrace.v2.AttributeValue> attribute_map = 1;

Returns
Type Description
int

getAttributeMapMap()

public Map<String,AttributeValue> getAttributeMapMap()

A set of attributes. Each attribute's key can be up to 128 bytes long. The value can be a string up to 256 bytes, a signed 64-bit integer, or the boolean values true or false. For example:

"/instance_id": { "string_value": { "value": "my-instance" } } "/http/request_bytes": { "int_value": 300 } "example.com/myattribute": { "bool_value": false }

map<string, .google.devtools.cloudtrace.v2.AttributeValue> attribute_map = 1;

Returns
Type Description
Map<String,AttributeValue>

getAttributeMapOrDefault(String key, AttributeValue defaultValue)

public AttributeValue getAttributeMapOrDefault(String key, AttributeValue defaultValue)

A set of attributes. Each attribute's key can be up to 128 bytes long. The value can be a string up to 256 bytes, a signed 64-bit integer, or the boolean values true or false. For example:

"/instance_id": { "string_value": { "value": "my-instance" } } "/http/request_bytes": { "int_value": 300 } "example.com/myattribute": { "bool_value": false }

map<string, .google.devtools.cloudtrace.v2.AttributeValue> attribute_map = 1;

Parameters
Name Description
key String
defaultValue AttributeValue
Returns
Type Description
AttributeValue

getAttributeMapOrThrow(String key)

public AttributeValue getAttributeMapOrThrow(String key)

A set of attributes. Each attribute's key can be up to 128 bytes long. The value can be a string up to 256 bytes, a signed 64-bit integer, or the boolean values true or false. For example:

"/instance_id": { "string_value": { "value": "my-instance" } } "/http/request_bytes": { "int_value": 300 } "example.com/myattribute": { "bool_value": false }

map<string, .google.devtools.cloudtrace.v2.AttributeValue> attribute_map = 1;

Parameter
Name Description
key String
Returns
Type Description
AttributeValue

getDefaultInstanceForType()

public Span.Attributes getDefaultInstanceForType()
Returns
Type Description
Span.Attributes

getDescriptorForType()

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

getDroppedAttributesCount()

public int getDroppedAttributesCount()

The number of attributes that were discarded. Attributes can be discarded because their keys are too long or because there are too many attributes. If this value is 0 then all attributes are valid.

int32 dropped_attributes_count = 2;

Returns
Type Description
int

The droppedAttributesCount.

getMutableAttributeMap() (deprecated)

public Map<String,AttributeValue> getMutableAttributeMap()

Use alternate mutation accessors instead.

Returns
Type Description
Map<String,AttributeValue>

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(Span.Attributes other)

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

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

putAllAttributeMap(Map<String,AttributeValue> values)

public Span.Attributes.Builder putAllAttributeMap(Map<String,AttributeValue> values)

A set of attributes. Each attribute's key can be up to 128 bytes long. The value can be a string up to 256 bytes, a signed 64-bit integer, or the boolean values true or false. For example:

"/instance_id": { "string_value": { "value": "my-instance" } } "/http/request_bytes": { "int_value": 300 } "example.com/myattribute": { "bool_value": false }

map<string, .google.devtools.cloudtrace.v2.AttributeValue> attribute_map = 1;

Parameter
Name Description
values Map<String,AttributeValue>
Returns
Type Description
Span.Attributes.Builder

putAttributeMap(String key, AttributeValue value)

public Span.Attributes.Builder putAttributeMap(String key, AttributeValue value)

A set of attributes. Each attribute's key can be up to 128 bytes long. The value can be a string up to 256 bytes, a signed 64-bit integer, or the boolean values true or false. For example:

"/instance_id": { "string_value": { "value": "my-instance" } } "/http/request_bytes": { "int_value": 300 } "example.com/myattribute": { "bool_value": false }

map<string, .google.devtools.cloudtrace.v2.AttributeValue> attribute_map = 1;

Parameters
Name Description
key String
value AttributeValue
Returns
Type Description
Span.Attributes.Builder

putAttributeMapBuilderIfAbsent(String key)

public AttributeValue.Builder putAttributeMapBuilderIfAbsent(String key)

A set of attributes. Each attribute's key can be up to 128 bytes long. The value can be a string up to 256 bytes, a signed 64-bit integer, or the boolean values true or false. For example:

"/instance_id": { "string_value": { "value": "my-instance" } } "/http/request_bytes": { "int_value": 300 } "example.com/myattribute": { "bool_value": false }

map<string, .google.devtools.cloudtrace.v2.AttributeValue> attribute_map = 1;

Parameter
Name Description
key String
Returns
Type Description
AttributeValue.Builder

removeAttributeMap(String key)

public Span.Attributes.Builder removeAttributeMap(String key)

A set of attributes. Each attribute's key can be up to 128 bytes long. The value can be a string up to 256 bytes, a signed 64-bit integer, or the boolean values true or false. For example:

"/instance_id": { "string_value": { "value": "my-instance" } } "/http/request_bytes": { "int_value": 300 } "example.com/myattribute": { "bool_value": false }

map<string, .google.devtools.cloudtrace.v2.AttributeValue> attribute_map = 1;

Parameter
Name Description
key String
Returns
Type Description
Span.Attributes.Builder

setDroppedAttributesCount(int value)

public Span.Attributes.Builder setDroppedAttributesCount(int value)

The number of attributes that were discarded. Attributes can be discarded because their keys are too long or because there are too many attributes. If this value is 0 then all attributes are valid.

int32 dropped_attributes_count = 2;

Parameter
Name Description
value int

The droppedAttributesCount to set.

Returns
Type Description
Span.Attributes.Builder

This builder for chaining.