-
public class DD64bTraceId extends DDTraceId
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 Modifier and Type Field Description public final static DD64bTraceIdMAX
-
Method Summary
Modifier and Type Method Description static DD64bTraceIdfrom(long id)Create a new DD64bTraceId from the given {@code long}interpreted as the bits of theunsigned 64-bit id.static DD64bTraceIdfrom(String s)Create a new {@code DDTraceId}from the given{@code String}representation of the unsigned 64bit id.static DD64bTraceIdfromHex(String s)Create a new {@code DDTraceId}from the given{@code String}hex representation of the unsigned64 bit id.booleanequals(Object o)inthashCode()StringtoString()Returns a 64-bit only decimal String representation of the DDTraceId. StringtoHexString()Returns the lower-case zero-padded 32 hexadecimal characters String representation ofthe DDTraceId. StringtoHexStringPadded(int size)Returns the lower-case zero-padded hexadecimal String representation ofthe DDTraceId. longtoLong()Returns the low-order 64 bits of the DDTraceId as an unsigned {@code long}.longtoHighOrderLong()Returns the high-order 64 bits of 128-bit DDTraceId as un unsigned {@code long}.-
-
Method Detail
-
from
static DD64bTraceId from(long id)
Create a new DD64bTraceId from the given
{@code long}interpreted as the bits of theunsigned 64-bit id. This means that values larger than Long.MAX_VALUE will be represented asnegative numbers.- Parameters:
id- The{@code long}representing the bits of the unsigned 64-bit id.
-
from
static DD64bTraceId from(String s)
Create a new
{@code DDTraceId}from the given{@code String}representation of the unsigned 64bit id.- Parameters:
s- String of unsigned 64 bit id
-
fromHex
static DD64bTraceId fromHex(String s)
Create a new
{@code DDTraceId}from the given{@code String}hex representation of the unsigned64 bit id.- Parameters:
s- String in hex of unsigned 64 bit id
-
hashCode
int hashCode()
-
toHexString
String toHexString()
-
toHexStringPadded
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
long toLong()
-
toHighOrderLong
long toHighOrderLong()
-
-
-
-