public class DD64bTraceId extends DDTraceId
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.
Modifier and Type | Field and Description |
---|---|
static DD64bTraceId |
MAX |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
static DD64bTraceId |
from(long id)
Create a new
DD64bTraceId from the given long interpreted as the bits of the
unsigned 64-bit id. |
static DD64bTraceId |
from(String s)
Create a new
DDTraceId from the given String representation of the unsigned 64
bit id. |
static DD64bTraceId |
fromHex(String s)
Create a new
DDTraceId from the given String hex representation of the unsigned
64 bit id. |
int |
hashCode() |
String |
toHexString()
|
String |
toHexStringPadded(int size)
Returns the lower-case zero-padded
hexadecimal String representation of
the DDTraceId . |
long |
toHighOrderLong()
Returns the high-order 64 bits of 128-bit
DDTraceId as un unsigned long . |
long |
toLong()
Returns the low-order 64 bits of the
DDTraceId as an unsigned long . |
String |
toString()
|
public static final DD64bTraceId MAX
public static DD64bTraceId from(long id)
DD64bTraceId
from the given long
interpreted as the bits of the
unsigned 64-bit id. This means that values larger than Long.MAX_VALUE will be represented as
negative numbers.id
- The long
representing the bits of the unsigned 64-bit id.DD64bTraceId
instance.public static DD64bTraceId from(String s) throws NumberFormatException
DDTraceId
from the given String
representation of the unsigned 64
bit id.s
- String of unsigned 64 bit idNumberFormatException
public static DD64bTraceId fromHex(String s) throws NumberFormatException
DDTraceId
from the given String
hex representation of the unsigned
64 bit id.s
- String in hex of unsigned 64 bit idNumberFormatException
public String toHexString()
DDTraceId
String
representation of
the DDTraceId
. The * String
will be cached.toHexString
in class DDTraceId
String
representation
of the DDTraceId
instance.public String toHexStringPadded(int size)
DDTraceId
hexadecimal String
representation of
the DDTraceId
. The size will be rounded up to 16
or 32
characters. This hexadecimal String
will not be cached.toHexStringPadded
in class DDTraceId
size
- The size in characters of the zero-padded String
(rounded up to 16
or 32
).String representation
representation of
the DDTraceId
instance.public long toLong()
DDTraceId
DDTraceId
as an unsigned long
. This means
that values larger than Long.MAX_VALUE
will be represented as negative numbers.public long toHighOrderLong()
DDTraceId
DDTraceId
as un unsigned long
. This
means that values larger than Long.MAX_VALUE
will be represented as negative numbers.toHighOrderLong
in class DDTraceId
DDTraceId
as an unsigned long
,
0
for 64-bit DDTraceId
only.