Package io.opentelemetry.api.internal
Class InternalAttributeKeyImpl<T>
java.lang.Object
io.opentelemetry.api.internal.InternalAttributeKeyImpl<T>
- All Implemented Interfaces:
AttributeKey<T>
Default AttributeKey implementation which preencodes to UTF8 for OTLP export.
This class is internal and is hence not for public use. Its APIs are unstable and can change at any time.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate int
private static int
buildHashCode
(AttributeType type, String key) static <T> AttributeKey
<T> create
(String key, AttributeType type) boolean
getKey()
Returns the underlying String representation of the key.byte[]
Returns the key, encoded as UTF-8 bytes.getType()
Returns the type of attribute for this key.int
hashCode()
toString()
-
Field Details
-
type
-
key
-
hashCode
private final int hashCode -
keyUtf8
-
-
Constructor Details
-
InternalAttributeKeyImpl
-
-
Method Details
-
create
-
getType
Description copied from interface:AttributeKey
Returns the type of attribute for this key. Useful for building switch statements.- Specified by:
getType
in interfaceAttributeKey<T>
-
getKey
Description copied from interface:AttributeKey
Returns the underlying String representation of the key.- Specified by:
getKey
in interfaceAttributeKey<T>
-
getKeyUtf8
public byte[] getKeyUtf8()Returns the key, encoded as UTF-8 bytes. -
equals
-
hashCode
public int hashCode() -
toString
-
buildHashCode
private int buildHashCode() -
buildHashCode
-