-
public abstract class DDTraceIdClass encapsulating the id used for TraceIds.
It contains parsing and formatting to string for both decimal and hexadecimal representations. The string representations are either kept from parsing, or generated on demand and cached.
-
-
Method Summary
Modifier and Type Method Description static DDTraceIdfrom(long id)Creates a new 64-bit TraceId from the given {@code long}interpreted asthe bits of the unsigned 64-bit id.static DDTraceIdfrom(String s)Creates a new 64-bit TraceId from the given String representation. static DDTraceIdfromHex(String s)Creates a new DDTraceId from the given hexadecimal representation. abstract StringtoString()Returns a 64-bit only decimal String representation of the DDTraceId. abstract StringtoHexString()Returns the lower-case zero-padded 32 hexadecimal characters String representation ofthe DDTraceId. abstract StringtoHexStringPadded(int size)Returns the lower-case zero-padded hexadecimal String representation ofthe DDTraceId. abstract longtoLong()Returns the low-order 64 bits of the DDTraceId as an unsigned {@code long}.abstract longtoHighOrderLong()Returns the high-order 64 bits of 128-bit DDTraceId as un unsigned {@code long}.-
-
Method Detail
-
from
static DDTraceId from(long id)
Creates a new 64-bit TraceId from the given
{@code long}interpreted asthe bits of the unsigned 64-bit id. This means that values larger than MAX_VALUE will be represented as negative numbers.- Parameters:
id- The{@code long}representing the bits of the unsigned 64-bit id.
-
from
static DDTraceId from(String s)
Creates a new 64-bit TraceId from the given String representation.
- Parameters:
s- The String representation of a DDTraceId.
-
fromHex
static DDTraceId fromHex(String s)
Creates a new DDTraceId from the given hexadecimal representation.
- Parameters:
s- The hexadecimal String representation of a DD128bTraceId to parse.
-
toHexString
abstract String toHexString()
-
toHexStringPadded
abstract String toHexStringPadded(int size)
Returns the lower-case zero-padded hexadecimal String representation ofthe DDTraceId. The size will be rounded up to
16or32characters. This hexadecimal Stringwill not be cached.- Parameters:
size- The size in characters of the zero-padded String (rounded up to16or32).
-
toLong
abstract long toLong()
-
toHighOrderLong
abstract long toHighOrderLong()
-
-
-
-