Package datadog.trace.api
Class DDSpanId
java.lang.Object
datadog.trace.api.DDSpanId
Class with methods for working with the unsigned 64 bit id used for Span ids.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic longParse the span id from the givenStringrepresentation of the unsigned 64 bit id.static longParse the span id from the givenStringhex representation of the unsigned 64 bit id.static longParse the span id from the givenStringhex representation of the unsigned 64 bit id.static StringtoHexString(long id) Returns the no zero padded hex representation, in lower case, of the unsigned 64 bit id.static StringtoHexStringPadded(long id) Returns the zero padded hex representation, in lower case, of the unsigned 64 bit id.static StringtoString(long id) Returns the decimal string representation of the unsigned 64 bit id.
-
Field Details
-
ZERO
public static final long ZEROThe ZERO span id is not allowed and means no span.- See Also:
-
MAX
public static final long MAX- See Also:
-
-
Method Details
-
from
Parse the span id from the givenStringrepresentation of the unsigned 64 bit id.- Parameters:
s- String of unsigned 64 bit id- Returns:
- long
- Throws:
NumberFormatException
-
fromHex
Parse the span id from the givenStringhex representation of the unsigned 64 bit id.- Parameters:
s- String in hex of unsigned 64 bit id- Returns:
- long
- Throws:
NumberFormatException
-
fromHex
public static long fromHex(String s, int start, int len, boolean lowerCaseOnly) throws NumberFormatException Parse the span id from the givenStringhex representation of the unsigned 64 bit id.- Parameters:
s- String in hex of unsigned 64 bit idstart- the start index of the hex valuelen- the len of the hex valuelowerCaseOnly- if the allowed hex characters are lower case only- Returns:
- long
- Throws:
NumberFormatException
-
toString
Returns the decimal string representation of the unsigned 64 bit id. TheStringwill NOT be cached.- Parameters:
id- the long 64 bit id to generate a String for- Returns:
- decimal string
-
toHexString
Returns the no zero padded hex representation, in lower case, of the unsigned 64 bit id. The hexStringwill NOT be cached.- Returns:
- non zero padded hex String
-
toHexStringPadded
Returns the zero padded hex representation, in lower case, of the unsigned 64 bit id. The size will be rounded up to 16 characters. The hexStringwill NOT be cached.- Returns:
- zero padded hex String
-