Package 

Class DDSpanId


  • 
    public final class DDSpanId
    
                        

    Class with methods for working with the unsigned 64 bit id used for Span ids.

    • Field Summary

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

      Modifier and Type Method Description
      static long from(String s) Parse the span id from the given {@code String} representation of the unsigned 64 bit id.
      static long fromHex(String s) Parse the span id from the given {@code String} hex representation of the unsigned 64 bit id.
      static long fromHex(String s, int start, int len, boolean lowerCaseOnly) Parse the span id from the given {@code String} hex representation of the unsigned 64 bit id.
      static String toString(long id) Returns the decimal string representation of the unsigned 64 bit id.
      static String toHexString(long id) Returns the no zero padded hex representation, in lower case, of the unsigned 64 bit id.
      static String toHexStringPadded(long id) Returns the zero padded hex representation, in lower case, of the unsigned 64 bit id.
      • Methods inherited from class java.lang.Object

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

      • from

         static long from(String s)

        Parse the span id from the given {@code String} representation of the unsigned 64 bit id.

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

         static long fromHex(String s)

        Parse the span id from the given {@code String} hex representation of the unsigned 64 bit id.

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

         static long fromHex(String s, int start, int len, boolean lowerCaseOnly)

        Parse the span id from the given {@code String} hex representation of the unsigned 64 bit id.

        Parameters:
        s - String in hex of unsigned 64 bit id
        start - the start index of the hex value
        len - the len of the hex value
        lowerCaseOnly - if the allowed hex characters are lower case only
      • toString

         static String toString(long id)

        Returns the decimal string representation of the unsigned 64 bit id. The {@code String} willNOT be cached.

        Parameters:
        id - the long 64 bit id to generate a String for
      • toHexString

         static String toHexString(long id)

        Returns the no zero padded hex representation, in lower case, of the unsigned 64 bit id. Thehex {@code String} will NOT be cached.

      • toHexStringPadded

         static String toHexStringPadded(long id)

        Returns the zero padded hex representation, in lower case, of the unsigned 64 bit id. The sizewill be rounded up to 16 characters. The hex {@code String} will NOT be cached.