Package datadog.trace.api
Class DD64bTraceId
java.lang.Object
datadog.trace.api.DDTraceId
datadog.trace.api.DD64bTraceId
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 -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic DD64bTraceIdfrom(long id) Create a newDD64bTraceIdfrom the givenlonginterpreted as the bits of the unsigned 64-bit id.static DD64bTraceIdCreate a newDDTraceIdfrom the givenStringrepresentation of the unsigned 64 bit id.static DD64bTraceIdCreate a newDDTraceIdfrom the givenStringhex representation of the unsigned 64 bit id.inthashCode()toHexStringPadded(int size) Returns the lower-case zero-paddedhexadecimal Stringrepresentation of theDDTraceId.longReturns the high-order 64 bits of 128-bitDDTraceIdas un unsignedlong.longtoLong()Returns the low-order 64 bits of theDDTraceIdas an unsignedlong.toString()
-
Field Details
-
MAX
-
-
Method Details
-
from
Create a newDD64bTraceIdfrom the givenlonginterpreted as the bits of the unsigned 64-bit id. This means that values larger than Long.MAX_VALUE will be represented as negative numbers.- Parameters:
id- Thelongrepresenting the bits of the unsigned 64-bit id.- Returns:
- A new
DD64bTraceIdinstance.
-
from
Create a newDDTraceIdfrom the givenStringrepresentation of the unsigned 64 bit id.- Parameters:
s- String of unsigned 64 bit id- Returns:
- DDTraceId
- Throws:
NumberFormatException
-
fromHex
Create a newDDTraceIdfrom the givenStringhex representation of the unsigned 64 bit id.- Parameters:
s- String in hex of unsigned 64 bit id- Returns:
- DDTraceId
- Throws:
NumberFormatException
-
equals
-
hashCode
public int hashCode() -
toString
Description copied from class:DDTraceId -
toHexString
Description copied from class:DDTraceIdReturns the lower-case zero-padded 32 hexadecimal charactersStringrepresentation of theDDTraceId. The *Stringwill be cached.- Specified by:
toHexStringin classDDTraceId- Returns:
- A cached lower-case zero-padded 32 hexadecimal characters
Stringrepresentation of theDDTraceIdinstance.
-
toHexStringPadded
Description copied from class:DDTraceIdReturns the lower-case zero-paddedhexadecimal Stringrepresentation of theDDTraceId. The size will be rounded up to16or32characters. This hexadecimalStringwill not be cached.- Specified by:
toHexStringPaddedin classDDTraceId- Parameters:
size- The size in characters of the zero-paddedString(rounded up to16or32).- Returns:
- A lower-case zero-padded
String representationrepresentation of theDDTraceIdinstance.
-
toLong
public long toLong()Description copied from class:DDTraceIdReturns the low-order 64 bits of theDDTraceIdas an unsignedlong. This means that values larger thanLong.MAX_VALUEwill be represented as negative numbers. -
toHighOrderLong
public long toHighOrderLong()Description copied from class:DDTraceIdReturns the high-order 64 bits of 128-bitDDTraceIdas un unsignedlong. This means that values larger thanLong.MAX_VALUEwill be represented as negative numbers.- Specified by:
toHighOrderLongin classDDTraceId- Returns:
- The high-order 64 bits of the 128-bit
DDTraceIdas an unsignedlong,0for 64-bitDDTraceIdonly.
-