Class Span.Attributes.Builder (2.40.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
TypeDescription
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

build()

public Span.Attributes build()
Returns
TypeDescription
Span.Attributes

buildPartial()

public Span.Attributes buildPartial()
Returns
TypeDescription
Span.Attributes

clear()

public Span.Attributes.Builder clear()
Returns
TypeDescription
Span.Attributes.Builder
Overrides

clearAttributeMap()

public Span.Attributes.Builder clearAttributeMap()
Returns
TypeDescription
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
TypeDescription
Span.Attributes.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

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

clearOneof(Descriptors.OneofDescriptor oneof)

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

clone()

public Span.Attributes.Builder clone()
Returns
TypeDescription
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
NameDescription
keyString
Returns
TypeDescription
boolean

getAttributeMap() (deprecated)

public Map<String,AttributeValue> getAttributeMap()

Use #getAttributeMapMap() instead.

Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
NameDescription
keyString
defaultValueAttributeValue
Returns
TypeDescription
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
NameDescription
keyString
Returns
TypeDescription
AttributeValue

getDefaultInstanceForType()

public Span.Attributes getDefaultInstanceForType()
Returns
TypeDescription
Span.Attributes

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
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
TypeDescription
int

The droppedAttributesCount.

getMutableAttributeMap() (deprecated)

public Map<String,AttributeValue> getMutableAttributeMap()

Use alternate mutation accessors instead.

Returns
TypeDescription
Map<String,AttributeValue>

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

internalGetMapFieldReflection(int number)

protected MapFieldReflectionAccessor internalGetMapFieldReflection(int number)
Parameter
NameDescription
numberint
Returns
TypeDescription
com.google.protobuf.MapFieldReflectionAccessor
Overrides
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMapFieldReflection(int)

internalGetMutableMapFieldReflection(int number)

protected MapFieldReflectionAccessor internalGetMutableMapFieldReflection(int number)
Parameter
NameDescription
numberint
Returns
TypeDescription
com.google.protobuf.MapFieldReflectionAccessor
Overrides
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMutableMapFieldReflection(int)

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(Span.Attributes other)

public Span.Attributes.Builder mergeFrom(Span.Attributes other)
Parameter
NameDescription
otherSpan.Attributes
Returns
TypeDescription
Span.Attributes.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

mergeUnknownFields(UnknownFieldSet unknownFields)

public final Span.Attributes.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
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
NameDescription
valuesMap<String,AttributeValue>
Returns
TypeDescription
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
NameDescription
keyString
valueAttributeValue
Returns
TypeDescription
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
NameDescription
keyString
Returns
TypeDescription
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
NameDescription
keyString
Returns
TypeDescription
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
NameDescription
valueint

The droppedAttributesCount to set.

Returns
TypeDescription
Span.Attributes.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public Span.Attributes.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
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
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
Span.Attributes.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

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