Package io.opentelemetry.api.common
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 Attributes
private 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.private
ArrayBackedAttributes
(Object[] data, Comparator<AttributeKey<?>> keyComparator) -
Method Summary
Modifier and TypeMethodDescription<T> T
get
(AttributeKey<T> key) Returns the value for the givenAttributeKey
, ornull
if not found.(package private) static Attributes
sortAndFilterToAttributes
(Object... data) Returns a newAttributesBuilder
instance populated with the data of thisAttributes
.Methods inherited from class io.opentelemetry.api.internal.ImmutableKeyValuePairs
asMap, data, equals, forEach, get, getData, hashCode, isEmpty, size, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.opentelemetry.api.common.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:Attributes
Returns a newAttributesBuilder
instance populated with the data of thisAttributes
.- Specified by:
toBuilder
in interfaceAttributes
-
get
Description copied from interface:Attributes
Returns the value for the givenAttributeKey
, ornull
if not found.- Specified by:
get
in interfaceAttributes
-
sortAndFilterToAttributes
-