Class Span.Attributes.Builder (2.43.0)

public static final class Span.Attributes.Builder extends GeneratedMessageV3.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

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

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.

clearField(Descriptors.FieldDescriptor field)

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

clearOneof(Descriptors.OneofDescriptor oneof)

public Span.Attributes.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
Span.Attributes.Builder
Overrides

clone()

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

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 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(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

mergeUnknownFields(UnknownFieldSet unknownFields)

public final Span.Attributes.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
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.

setField(Descriptors.FieldDescriptor field, Object value)

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

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

public Span.Attributes.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
Span.Attributes.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

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