Top Fields Constructors Methods
io.opentelemetry.api.common

pack-priv final Class ArrayBackedAttributes

extends ImmutableKeyValuePairs<AttributeKey<?>, Object>
implements Attributes
Class Inheritance
All Implemented Interfaces
io.opentelemetry.api.common.Attributes
Annotations
@Immutable
Imports
io.opentelemetry.api.internal.ImmutableKeyValuePairs, java.util.ArrayList, .Comparator, javax.annotation.Nullable, javax.annotation.concurrent.Immutable

Field Summary

Modifier and TypeField and Description
pack-priv static final Attributes
private static final Comparator<AttributeKey<?>>

Constructor Summary

AccessConstructor and Description
private
pack-priv
ArrayBackedAttributes(Object[]
the raw data
data
)

Only use this constructor if you can guarantee that the data has been de-duped, sorted by key and contains no null values or null/empty keys.

Method Summary

Modifier and TypeMethod and Description
public <T> T
get(AttributeKey<T> key)

Overrides io.opentelemetry.api.internal.ImmutableKeyValuePairs.get.

Implements io.opentelemetry.api.common.Attributes.get.

Returns the value for the given AttributeKey, or null if not found.

pack-priv static Attributes
public AttributesBuilder
toBuilder()

Implements io.opentelemetry.api.common.Attributes.toBuilder.

Returns a new AttributesBuilder instance populated with the data of this Attributes.

Inherited from io.opentelemetry.api.internal.ImmutableKeyValuePairs:
asMapdataequalsforEachgetDatahashCodeisEmptysizetoString

Field Detail

EMPTYback to summary
pack-priv static final Attributes EMPTY
KEY_COMPARATOR_FOR_CONSTRUCTIONback to summary
private static final Comparator<AttributeKey<?>> KEY_COMPARATOR_FOR_CONSTRUCTION

Constructor Detail

ArrayBackedAttributesback to summary
private ArrayBackedAttributes(Object[] data, Comparator<AttributeKey<?>> keyComparator)
ArrayBackedAttributesback to summary
pack-priv ArrayBackedAttributes(Object[] data)

Only use this constructor if you can guarantee that the data has been de-duped, sorted by key and contains no null values or null/empty keys.

Parameters
data:Object[]

the raw data

Method Detail

getback to summary
public <T> T get(AttributeKey<T> key)

Overrides io.opentelemetry.api.internal.ImmutableKeyValuePairs.get.

Implements io.opentelemetry.api.common.Attributes.get.

Doc from io.opentelemetry.api.common.Attributes.get.

Returns the value for the given AttributeKey, or null if not found.

Annotations
@SuppressWarnings:unchecked
@Override
@Nullable
sortAndFilterToAttributesback to summary
pack-priv static Attributes sortAndFilterToAttributes(Object... data)
toBuilderback to summary
public AttributesBuilder toBuilder()

Implements io.opentelemetry.api.common.Attributes.toBuilder.

Doc from io.opentelemetry.api.common.Attributes.toBuilder.

Returns a new AttributesBuilder instance populated with the data of this Attributes.

Annotations
@Override