Package io.opentelemetry.api.trace
Class ImmutableTraceFlags
- java.lang.Object
-
- io.opentelemetry.api.trace.ImmutableTraceFlags
-
- All Implemented Interfaces:
TraceFlags
@Immutable final class ImmutableTraceFlags extends java.lang.Object implements TraceFlags
-
-
Field Summary
Fields Modifier and Type Field Description private bytebyteRep(package private) static ImmutableTraceFlagsDEFAULT(package private) static intHEX_LENGTHprivate java.lang.StringhexRepprivate static ImmutableTraceFlags[]INSTANCES(package private) static ImmutableTraceFlagsSAMPLEDprivate static byteSAMPLED_BIT
-
Constructor Summary
Constructors Modifier Constructor Description privateImmutableTraceFlags(byte byteRep)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description byteasByte()Returns the byte representation of thisTraceFlags.java.lang.StringasHex()Returns the lowercase hex (base16) representation of thisTraceFlags.private static ImmutableTraceFlags[]buildInstances()(package private) static ImmutableTraceFlagsfromByte(byte traceFlagsByte)Returns theTraceFlagsconverted from the given byte representation.(package private) static ImmutableTraceFlagsfromHex(java.lang.CharSequence src, int srcOffset)Returns theTraceFlagsconverted from the given lowercase hex (base16) representation.booleanisSampled()java.lang.StringtoString()
-
-
-
Field Detail
-
INSTANCES
private static final ImmutableTraceFlags[] INSTANCES
-
SAMPLED_BIT
private static final byte SAMPLED_BIT
- See Also:
- Constant Field Values
-
DEFAULT
static final ImmutableTraceFlags DEFAULT
-
SAMPLED
static final ImmutableTraceFlags SAMPLED
-
HEX_LENGTH
static final int HEX_LENGTH
- See Also:
- Constant Field Values
-
hexRep
private final java.lang.String hexRep
-
byteRep
private final byte byteRep
-
-
Method Detail
-
fromHex
static ImmutableTraceFlags fromHex(java.lang.CharSequence src, int srcOffset)
Description copied from interface:TraceFlagsReturns theTraceFlagsconverted from the given lowercase hex (base16) representation.This may throw runtime exceptions if the input is invalid.
- Parameters:
src- the buffer where the hex (base16) representation of theTraceFlagsis.srcOffset- the offset int buffer.- Returns:
- the
TraceFlagsconverted from the given lowercase hex (base16) representation.
-
fromByte
static ImmutableTraceFlags fromByte(byte traceFlagsByte)
Description copied from interface:TraceFlagsReturns theTraceFlagsconverted from the given byte representation.- Parameters:
traceFlagsByte- the byte representation of theTraceFlags.- Returns:
- the
TraceFlagsconverted from the given byte representation.
-
buildInstances
private static ImmutableTraceFlags[] buildInstances()
-
isSampled
public boolean isSampled()
Description copied from interface:TraceFlags- Specified by:
isSampledin interfaceTraceFlags- Returns:
trueif the sampling bit is on for thisTraceFlags, otherwise* false.
-
asHex
public java.lang.String asHex()
Description copied from interface:TraceFlagsReturns the lowercase hex (base16) representation of thisTraceFlags.- Specified by:
asHexin interfaceTraceFlags- Returns:
- the byte representation of the
TraceFlags.
-
asByte
public byte asByte()
Description copied from interface:TraceFlagsReturns the byte representation of thisTraceFlags.- Specified by:
asBytein interfaceTraceFlags- Returns:
- the byte representation of the
TraceFlags.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-