Class ArrayBackedAttributes
java.lang.Object
io.opentelemetry.api.internal.ImmutableKeyValuePairs<AttributeKey<?>, Object>
io.opentelemetry.api.common.ArrayBackedAttributes
- All Implemented Interfaces:
Attributes
@Immutable
final class ArrayBackedAttributes
extends ImmutableKeyValuePairs<AttributeKey<?>, Object>
implements Attributes
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final Attributesprivate static final Comparator<AttributeKey<?>> -
Constructor Summary
ConstructorsModifierConstructorDescription(package private)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.privateArrayBackedAttributes(Object[] data, Comparator<AttributeKey<?>> keyComparator) -
Method Summary
Modifier and TypeMethodDescription<T> Tget(AttributeKey<T> key) Returns the value for the givenAttributeKey, ornullif not found.(package private) static AttributessortAndFilterToAttributes(Object... data) Returns a newAttributesBuilderinstance populated with the data of thisAttributes.Methods inherited from class ImmutableKeyValuePairs
asMap, data, equals, forEach, get, getData, hashCode, isEmpty, size, toStringMethods inherited from interface Attributes
asMap, forEach, isEmpty, size
-
Field Details
-
KEY_COMPARATOR_FOR_CONSTRUCTION
-
EMPTY
-
-
Constructor Details
-
ArrayBackedAttributes
-
ArrayBackedAttributes
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- the raw data
-
-
Method Details
-
toBuilder
Description copied from interface:AttributesReturns a newAttributesBuilderinstance populated with the data of thisAttributes.- Specified by:
toBuilderin interfaceAttributes
-
get
Description copied from interface:AttributesReturns the value for the givenAttributeKey, ornullif not found.- Specified by:
getin interfaceAttributes
-
sortAndFilterToAttributes
-