Class InternalAttributeKeyImpl<T>

  • All Implemented Interfaces:
    AttributeKey<T>

    public final class InternalAttributeKeyImpl<T>
    extends java.lang.Object
    implements 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 Detail

      • key

        private final java.lang.String key
      • hashCode

        private final int hashCode
      • keyUtf8

        @Nullable
        private byte[] keyUtf8
    • Constructor Detail

      • InternalAttributeKeyImpl

        private InternalAttributeKeyImpl​(AttributeType type,
                                         java.lang.String key)
    • Method Detail

      • getType

        public AttributeType getType()
        Description copied from interface: AttributeKey
        Returns the type of attribute for this key. Useful for building switch statements.
        Specified by:
        getType in interface AttributeKey<T>
      • getKey

        public java.lang.String getKey()
        Description copied from interface: AttributeKey
        Returns the underlying String representation of the key.
        Specified by:
        getKey in interface AttributeKey<T>
      • getKeyUtf8

        public byte[] getKeyUtf8()
        Returns the key, encoded as UTF-8 bytes.
      • equals

        public boolean equals​(@Nullable
                              java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • buildHashCode

        private int buildHashCode()
      • buildHashCode

        private static int buildHashCode​(AttributeType type,
                                         java.lang.String key)