Package 

Class DD64bTraceId


  • 
    public class DD64bTraceId
    extends DDTraceId
                        

    Class encapsulating the unsigned 64 bit id used for Traceids.

    It contains generation of new ids, parsing, and to string for both decimal and hex representations. The decimal string representation is either kept from parsing, or generated on demand and cached.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      public final static DD64bTraceId MAX
    • Method Summary

      Modifier and Type Method Description
      static DD64bTraceId from(long id) Create a new DD64bTraceId from the given {@code long} interpreted as the bits of theunsigned 64-bit id.
      static DD64bTraceId from(String s) Create a new {@code DDTraceId} from the given {@code String} representation of the unsigned 64bit id.
      static DD64bTraceId fromHex(String s) Create a new {@code DDTraceId} from the given {@code String} hex representation of the unsigned64 bit id.
      boolean equals(Object o)
      int hashCode()
      String toString() Returns a 64-bit only decimal String representation of the DDTraceId.
      String toHexString() Returns the lower-case zero-padded 32 hexadecimal characters String representation ofthe DDTraceId.
      String toHexStringPadded(int size) Returns the lower-case zero-padded hexadecimal String representation ofthe DDTraceId.
      long toLong() Returns the low-order 64 bits of the DDTraceId as an unsigned {@code long}.
      long toHighOrderLong() Returns the high-order 64 bits of 128-bit DDTraceId as un unsigned {@code long}.
      • Methods inherited from class com.datadog.trace.api.DDTraceId

        from, from, fromHex
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • from

         static DD64bTraceId from(long id)

        Create a new DD64bTraceId from the given {@code long} interpreted as the bits of theunsigned 64-bit id. This means that values larger than Long.MAX_VALUE will be represented asnegative numbers.

        Parameters:
        id - The {@code long} representing the bits of the unsigned 64-bit id.
      • from

         static DD64bTraceId from(String s)

        Create a new {@code DDTraceId} from the given {@code String} representation of the unsigned 64bit id.

        Parameters:
        s - String of unsigned 64 bit id
      • fromHex

         static DD64bTraceId fromHex(String s)

        Create a new {@code DDTraceId} from the given {@code String} hex representation of the unsigned64 bit id.

        Parameters:
        s - String in hex of unsigned 64 bit id
      • toHexStringPadded

         String toHexStringPadded(int size)

        Returns the lower-case zero-padded hexadecimal String representation ofthe DDTraceId. The size will be rounded up to 16 or 32characters. This hexadecimal Stringwill not be cached.

        Parameters:
        size - The size in characters of the zero-padded String (rounded up to 16 or 32).
      • toLong

         long toLong()

        Returns the low-order 64 bits of the DDTraceId as an unsigned {@code long}. This meansthat values larger than MAX_VALUE will be represented as negative numbers.

      • toHighOrderLong

         long toHighOrderLong()

        Returns the high-order 64 bits of 128-bit DDTraceId as un unsigned {@code long}. Thismeans that values larger than MAX_VALUE will be represented as negative numbers.