There are two more other representation that this class helps with:
long values, where valid means that at least one of values is non-zero.
To avoid allocating new objects this representation uses two parts, "high part"
representing the left most part of the TraceId and "low part" representing the
right most part of the TraceId. This is equivalent with the values being stored as
big-endian.
| Modifier and Type | Field and Description |
|---|---|
| private static final int | |
| private static final int | |
| private static final String |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static String | Returns: the lowercase hex (base16) representation of theTraceId.the bytes (16-byte array) representation of the traceIdBytes)TraceId.Returns the lowercase hex (base16) representation of the |
| public static String | Returns: the lowercase hex (base16) representation of theTraceId.the higher part of the long values representation of the traceIdLongHighPart, long TraceId.the lower part of the long values representation of the traceIdLongLowPart)TraceId.Returns the bytes (16-byte array) representation of the |
| public static String | Returns: the invalidTraceId in lowercase hex (base16) representation.Returns the invalid |
| public static int | Returns: the length of the lowercase hex (base16) representation of theTraceId.Returns the length of the lowercase hex (base16) representation of the |
| public static boolean | Returns: true if the TraceId is valid.Returns whether the |
| BYTES_LENGTH | back to summary |
|---|---|
| private static final int BYTES_LENGTH | |
| HEX_LENGTH | back to summary |
|---|---|
| private static final int HEX_LENGTH | |
| INVALID | back to summary |
|---|---|
| private static final String INVALID | |
| TraceId | back to summary |
|---|---|
| private TraceId() | |
| fromBytes | back to summary |
|---|---|
| public static String fromBytes(byte[] traceIdBytes) Returns the lowercase hex (base16) representation of the It converts the first 26 bytes of the given byte array.
| |
| fromLongs | back to summary |
|---|---|
| public static String fromLongs(long traceIdLongHighPart, long traceIdLongLowPart) Returns the bytes (16-byte array) representation of the There is no restriction on the specified values, other than the already established validity
rules applying to This is equivalent to calling
| |
| getInvalid | back to summary |
|---|---|
| public static String getInvalid() Returns the invalid
| |
| getLength | back to summary |
|---|---|
| public static int getLength() Returns the length of the lowercase hex (base16) representation of the
| |
| isValid | back to summary |
|---|---|
| public static boolean isValid(CharSequence traceId) Returns whether the
| |