@Immutable public final class SpanId extends Object implements Comparable<SpanId>
| Constructor and Description |
|---|
SpanId(long id)
Constructs a
SpanId whose representation is specified by a long value. |
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(SpanId that) |
void |
copyBytesTo(byte[] dest,
int destOffset)
Copies the byte array representations of the
SpanId into the dest beginning at
the destOffset offset. |
void |
copyLowerBase16To(char[] dest,
int destOffset)
Copies the lowercase base16 representations of the
SpanId into the dest
beginning at the destOffset offset. |
boolean |
equals(Object obj) |
static SpanId |
fromBytes(byte[] src,
int srcOffset)
Returns a
SpanId whose representation is copied from the src beginning at the
srcOffset offset. |
static SpanId |
fromLowerBase16(CharSequence src,
int srcOffset)
Returns a
SpanId built from a lowercase base16 representation. |
static SpanId |
getInvalid()
Returns the invalid
SpanId. |
static int |
getSize()
Returns the size in bytes of the
SpanId. |
int |
hashCode() |
boolean |
isValid()
Returns whether the span identifier is valid.
|
String |
toLowerBase16()
Returns the lowercase base16 encoding of this
SpanId. |
String |
toString() |
public SpanId(long id)
SpanId whose representation is specified by a long value.
There is no restriction on the specified value, other than the already established validity
rules applying to SpanId. Specifying 0 for this value will effectively make the new
SpanId invalid.
This is equivalent to calling fromBytes(byte[], int) with the specified value
stored as big-endian.
id - the long representation of the TraceId.public static int getSize()
SpanId.SpanId.public static SpanId getInvalid()
SpanId. All bytes are 0.SpanId.public static SpanId fromBytes(byte[] src, int srcOffset)
SpanId whose representation is copied from the src beginning at the
srcOffset offset.src - the buffer where the representation of the SpanId is copied.srcOffset - the offset in the buffer where the representation of the SpanId
begins.SpanId whose representation is copied from the buffer.NullPointerException - if src is null.IndexOutOfBoundsException - if srcOffset+SpanId.getSize() is greater than src.length.public void copyBytesTo(byte[] dest,
int destOffset)
SpanId into the dest beginning at
the destOffset offset.dest - the destination buffer.destOffset - the starting offset in the destination buffer.NullPointerException - if dest is null.IndexOutOfBoundsException - if destOffset+SpanId.getSize() is greater than dest.length.public static SpanId fromLowerBase16(CharSequence 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 void copyLowerBase16To(char[] dest,
int destOffset)
SpanId into the dest
beginning at the destOffset offset.dest - the destination buffer.destOffset - the starting offset in the destination buffer.IndexOutOfBoundsException - if destOffset + 2 * SpanId.getSize() is greater than
dest.length.public boolean isValid()
true if the span identifier is valid.public String toLowerBase16()
SpanId.SpanId.public int compareTo(SpanId that)
compareTo in interface Comparable<SpanId>