Interface ExtendedAttributesBuilder
ExtendedAttributes supporting an arbitrary number of key-value pairs.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Create theExtendedAttributesfrom this.default <T> ExtendedAttributesBuilderPuts a List attribute into this.default <T> ExtendedAttributesBuilderput(io.opentelemetry.api.common.AttributeKey<T> key, T value) Puts aAttributeKeywith associated value into this.put(ExtendedAttributeKey<T> key, T value) Puts aExtendedAttributeKeywith associated value into this.default ExtendedAttributesBuilderPuts a boolean attribute into this.default ExtendedAttributesBuilderPuts a Boolean array attribute into this.default ExtendedAttributesBuilderPuts a double attribute into this.default ExtendedAttributesBuilderPuts a Double array attribute into this.default ExtendedAttributesBuilderPuts a long attribute into this.default ExtendedAttributesBuilderPuts a Long array attribute into this.default <T> ExtendedAttributesBuilderput(String key, ExtendedAttributes value) Puts aExtendedAttributesattribute into this.default ExtendedAttributesBuilderPuts a String attribute into this.default ExtendedAttributesBuilderPuts a String array attribute into this.default ExtendedAttributesBuilderputAll(io.opentelemetry.api.common.Attributes attributes) Puts all the provided attributes into this Builder.default ExtendedAttributesBuilderputAll(ExtendedAttributes attributes) Puts all the provided attributes into this Builder.default <T> ExtendedAttributesBuilderremove(io.opentelemetry.api.common.AttributeKey<T> key) Remove all attributes whereAttributeKey.getKey()andAttributeKey.getType()match thekey.default <T> ExtendedAttributesBuilderremove(ExtendedAttributeKey<T> key) Remove all attributes whereExtendedAttributeKey.getKey()andExtendedAttributeKey.getType()match thekey.removeIf(Predicate<ExtendedAttributeKey<?>> filter) Remove all attributes that satisfy the given predicate.
-
Method Details
-
build
ExtendedAttributes build()Create theExtendedAttributesfrom this. -
put
Puts aAttributeKeywith associated value into this. -
put
Puts aExtendedAttributeKeywith associated value into this. -
put
Puts a String attribute into this.Note: It is strongly recommended to use
put(ExtendedAttributeKey, Object), and pre-allocate your keys, if possible.- Returns:
- this Builder
-
put
Puts a long attribute into this.Note: It is strongly recommended to use
put(ExtendedAttributeKey, Object), and pre-allocate your keys, if possible.- Returns:
- this Builder
-
put
Puts a double attribute into this.Note: It is strongly recommended to use
put(ExtendedAttributeKey, Object), and pre-allocate your keys, if possible.- Returns:
- this Builder
-
put
Puts a boolean attribute into this.Note: It is strongly recommended to use
put(ExtendedAttributeKey, Object), and pre-allocate your keys, if possible.- Returns:
- this Builder
-
put
Puts aExtendedAttributesattribute into this.Note: It is strongly recommended to use
put(ExtendedAttributeKey, Object), and pre-allocate your keys, if possible.- Returns:
- this Builder
-
put
Puts a String array attribute into this.Note: It is strongly recommended to use
put(ExtendedAttributeKey, Object), and pre-allocate your keys, if possible.- Returns:
- this Builder
-
put
default <T> ExtendedAttributesBuilder put(io.opentelemetry.api.common.AttributeKey<List<T>> key, T... value) Puts a List attribute into this.- Returns:
- this Builder
-
put
Puts a Long array attribute into this.Note: It is strongly recommended to use
put(ExtendedAttributeKey, Object), and pre-allocate your keys, if possible.- Returns:
- this Builder
-
put
Puts a Double array attribute into this.Note: It is strongly recommended to use
put(ExtendedAttributeKey, Object), and pre-allocate your keys, if possible.- Returns:
- this Builder
-
put
Puts a Boolean array attribute into this.Note: It is strongly recommended to use
put(ExtendedAttributeKey, Object), and pre-allocate your keys, if possible.- Returns:
- this Builder
-
putAll
Puts all the provided attributes into this Builder.- Returns:
- this Builder
-
putAll
Puts all the provided attributes into this Builder.- Returns:
- this Builder
-
remove
Remove all attributes whereAttributeKey.getKey()andAttributeKey.getType()match thekey.- Returns:
- this Builder
-
remove
Remove all attributes whereExtendedAttributeKey.getKey()andExtendedAttributeKey.getType()match thekey.- Returns:
- this Builder
-
removeIf
Remove all attributes that satisfy the given predicate. Errors or runtime exceptions thrown by the predicate are relayed to the caller.- Returns:
- this Builder
-