Package io.opentelemetry.api.common
Class ArrayBackedAttributesBuilder
- java.lang.Object
-
- io.opentelemetry.api.common.ArrayBackedAttributesBuilder
-
- All Implemented Interfaces:
AttributesBuilder
class ArrayBackedAttributesBuilder extends java.lang.Object implements AttributesBuilder
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<java.lang.Object>
data
-
Constructor Summary
Constructors Constructor Description ArrayBackedAttributesBuilder()
ArrayBackedAttributesBuilder(java.util.List<java.lang.Object> data)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Attributes
build()
Create theAttributes
from this.<T> AttributesBuilder
put(AttributeKey<java.lang.Long> key, int value)
Puts aAttributeKey
with associated value into this.<T> AttributesBuilder
put(AttributeKey<T> key, T value)
Puts aAttributeKey
with associated value into this.AttributesBuilder
putAll(Attributes attributes)
Puts all the provided attributes into this Builder.<T> AttributesBuilder
remove(AttributeKey<T> key)
AttributesBuilder
removeIf(java.util.function.Predicate<AttributeKey<?>> predicate)
Remove all attributes that satisfy the given predicate.(package private) static java.util.List<java.lang.Boolean>
toList(boolean... values)
(package private) static java.util.List<java.lang.Double>
toList(double... values)
(package private) static java.util.List<java.lang.Long>
toList(long... values)
-
-
-
Method Detail
-
build
public Attributes build()
Description copied from interface:AttributesBuilder
Create theAttributes
from this.- Specified by:
build
in interfaceAttributesBuilder
-
put
public <T> AttributesBuilder put(AttributeKey<java.lang.Long> key, int value)
Description copied from interface:AttributesBuilder
Puts aAttributeKey
with associated value into this.The type parameter is unused.
- Specified by:
put
in interfaceAttributesBuilder
-
put
public <T> AttributesBuilder put(AttributeKey<T> key, T value)
Description copied from interface:AttributesBuilder
Puts aAttributeKey
with associated value into this.- Specified by:
put
in interfaceAttributesBuilder
-
putAll
public AttributesBuilder putAll(Attributes attributes)
Description copied from interface:AttributesBuilder
Puts all the provided attributes into this Builder.- Specified by:
putAll
in interfaceAttributesBuilder
- Returns:
- this Builder
-
remove
public <T> AttributesBuilder remove(AttributeKey<T> key)
Description copied from interface:AttributesBuilder
- Specified by:
remove
in interfaceAttributesBuilder
- Returns:
- this Builder
-
removeIf
public AttributesBuilder removeIf(java.util.function.Predicate<AttributeKey<?>> predicate)
Description copied from interface:AttributesBuilder
Remove all attributes that satisfy the given predicate. Errors or runtime exceptions thrown by the predicate are relayed to the caller.- Specified by:
removeIf
in interfaceAttributesBuilder
- Returns:
- this Builder
-
toList
static java.util.List<java.lang.Double> toList(double... values)
-
toList
static java.util.List<java.lang.Long> toList(long... values)
-
toList
static java.util.List<java.lang.Boolean> toList(boolean... values)
-
-