Interface ExtendedAttributeKey<T>
- Type Parameters:
T- The type of value that can be set with the key.
@Immutable
public interface ExtendedAttributeKey<T>
This interface provides a handle for setting the values of
ExtendedAttributes. The type
of value that can be set with an implementation of this key is denoted by the type parameter.
Implementations MUST be immutable, as these are used as the keys to Maps.
The allowed getType()s is a superset of those allowed in AttributeKey.
Convenience methods are provided for translating to / from AttributeKey:
asAttributeKey()converts fromExtendedAttributeKeytoAttributeKeyfromAttributeKey(AttributeKey)converts fromAttributeKeytoExtendedAttributeKey
-
Method Summary
Modifier and TypeMethodDescriptiondefault io.opentelemetry.api.common.AttributeKey<T>static ExtendedAttributeKey<List<Boolean>>booleanArrayKey(String key) Returns a new ExtendedAttributeKey for List<Boolean> valued attributes.static ExtendedAttributeKey<Boolean>booleanKey(String key) Returns a new ExtendedAttributeKey for Boolean valued attributes.static ExtendedAttributeKey<List<Double>>doubleArrayKey(String key) Returns a new ExtendedAttributeKey for List<Double> valued attributes.static ExtendedAttributeKey<Double>Returns a new ExtendedAttributeKey for Double valued attributes.Returns a new ExtendedAttributeKey for Map valued attributes.static <T> ExtendedAttributeKey<T>fromAttributeKey(io.opentelemetry.api.common.AttributeKey<T> attributeKey) Return an ExtendedAttributeKey equivalent to theattributeKey.getKey()Returns the underlying String representation of the key.getType()Returns the type of attribute for this key.static ExtendedAttributeKey<List<Long>>longArrayKey(String key) Returns a new ExtendedAttributeKey for List<Long> valued attributes.static ExtendedAttributeKey<Long>Returns a new ExtendedAttributeKey for Long valued attributes.static ExtendedAttributeKey<List<String>>stringArrayKey(String key) Returns a new ExtendedAttributeKey for List<String> valued attributes.static ExtendedAttributeKey<String>Returns a new ExtendedAttributeKey for String valued attributes.
-
Method Details
-
getKey
String getKey()Returns the underlying String representation of the key. -
getType
ExtendedAttributeType getType()Returns the type of attribute for this key. Useful for building switch statements. -
asAttributeKey
-
fromAttributeKey
static <T> ExtendedAttributeKey<T> fromAttributeKey(io.opentelemetry.api.common.AttributeKey<T> attributeKey) Return an ExtendedAttributeKey equivalent to theattributeKey. -
stringKey
Returns a new ExtendedAttributeKey for String valued attributes. -
booleanKey
Returns a new ExtendedAttributeKey for Boolean valued attributes. -
longKey
Returns a new ExtendedAttributeKey for Long valued attributes. -
doubleKey
Returns a new ExtendedAttributeKey for Double valued attributes. -
stringArrayKey
Returns a new ExtendedAttributeKey for List<String> valued attributes. -
booleanArrayKey
Returns a new ExtendedAttributeKey for List<Boolean> valued attributes. -
longArrayKey
Returns a new ExtendedAttributeKey for List<Long> valued attributes. -
doubleArrayKey
Returns a new ExtendedAttributeKey for List<Double> valued attributes. -
extendedAttributesKey
Returns a new ExtendedAttributeKey for Map valued attributes.
-