Package io.opentelemetry.api.common
Class ArrayBackedAttributes
- java.lang.Object
-
- io.opentelemetry.api.internal.ImmutableKeyValuePairs<AttributeKey<?>,java.lang.Object>
-
- io.opentelemetry.api.common.ArrayBackedAttributes
-
- All Implemented Interfaces:
Attributes
@Immutable final class ArrayBackedAttributes extends ImmutableKeyValuePairs<AttributeKey<?>,java.lang.Object> implements Attributes
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static AttributesEMPTYprivate static java.util.Comparator<AttributeKey<?>>KEY_COMPARATOR_FOR_CONSTRUCTION
-
Constructor Summary
Constructors Modifier Constructor Description (package private)ArrayBackedAttributes(java.lang.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(java.lang.Object[] data, java.util.Comparator<AttributeKey<?>> keyComparator)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> Tget(AttributeKey<T> key)Returns the value for the givenAttributeKey, ornullif not found.(package private) static AttributessortAndFilterToAttributes(java.lang.Object... data)AttributesBuildertoBuilder()Returns a newAttributesBuilderinstance 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 Detail
-
KEY_COMPARATOR_FOR_CONSTRUCTION
private static final java.util.Comparator<AttributeKey<?>> KEY_COMPARATOR_FOR_CONSTRUCTION
-
EMPTY
static final Attributes EMPTY
-
-
Constructor Detail
-
ArrayBackedAttributes
private ArrayBackedAttributes(java.lang.Object[] data, java.util.Comparator<AttributeKey<?>> keyComparator)
-
ArrayBackedAttributes
ArrayBackedAttributes(java.lang.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 Detail
-
toBuilder
public AttributesBuilder toBuilder()
Description copied from interface:AttributesReturns a newAttributesBuilderinstance populated with the data of thisAttributes.- Specified by:
toBuilderin interfaceAttributes
-
get
@Nullable public <T> T get(AttributeKey<T> key)
Description copied from interface:AttributesReturns the value for the givenAttributeKey, ornullif not found.- Specified by:
getin interfaceAttributes
-
sortAndFilterToAttributes
static Attributes sortAndFilterToAttributes(java.lang.Object... data)
-
-