@Immutable public final class SpanId extends Object
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
bytesFromHex(String src,
int srcOffset)
Returns a
SpanId built from a lowercase base16 representation. |
static String |
bytesToHex(byte[] spanId)
Encode the bytes as base-16 (hex), padded with '0's on the left.
|
static String |
fromLong(long id)
Generate a valid
SpanId from the given long value. |
static int |
getHexLength()
Returns the length of the base16 (hex) representation of the
SpanId. |
static String |
getInvalid()
Returns the invalid
SpanId. |
static int |
getSize()
Returns the size in bytes of the
SpanId. |
static boolean |
isValid(String spanId)
Returns whether the span identifier is valid.
|
public static int getSize()
SpanId.SpanId.public static int getHexLength()
SpanId.public static String getInvalid()
SpanId. All bytes are 0.SpanId.public static byte[] bytesFromHex(String src, int srcOffset)
SpanId built from a lowercase base16 representation.src - the lowercase base16 representation.srcOffset - the offset in the buffer where the representation of the SpanId
begins.SpanId built from a lowercase base16 representation.NullPointerException - if src is null.IllegalArgumentException - if not enough characters in the src from the srcOffset.public static boolean isValid(String spanId)
true if the span identifier is valid.public static String bytesToHex(byte[] spanId)