Top Fields Constructors Methods
io.opentelemetry.api.trace

pack-priv final Class ArrayBasedTraceStateBuilder

extends Object
implements TraceStateBuilder
Class Inheritance
All Implemented Interfaces
io.opentelemetry.api.trace.TraceStateBuilder
Imports
io.opentelemetry.api.internal.StringUtils, java.util.ArrayList, .Arrays, .Collections, .List, javax.annotation.Nullable

Field Summary

Modifier and TypeField and Description
private static final ArrayBasedTraceState
private static final int
private static final int
private static final int
private static final int
pack-priv int
private final List<String>
private static final int

Constructor Summary

AccessConstructor and Description
pack-priv
pack-priv

Method Summary

Modifier and TypeMethod and Description
public TraceState
build()

Implements io.opentelemetry.api.trace.TraceStateBuilder.build.

Builds a TraceState by adding the entries to the parent in front of the key-value pairs list and removing duplicate entries.

pack-priv static TraceState
private static boolean

Returns:

boolean representing key validity
isKeyValid
(String
is an opaque string up to 256 characters printable. It MUST begin with a lowercase letter, and can only contain lowercase letters a-z, digits 0-9, underscores _, dashes -, asterisks *, and forward slashes /. For multi-tenant vendor scenarios, an at sign (@) can be used to prefix the vendor name. The tenant id (before the '@') is limited to 240 characters and the vendor id is limited to 13 characters. If in the multi-tenant vendor format, then the first character may additionally be numeric.
key
)

Checks the validity of a key.

private static boolean
isNotDigit(char ch)

private static boolean
private static boolean
private static boolean
public TraceStateBuilder
put(String
is an opaque string up to 256 characters printable. It MUST begin with a lowercase letter, and can only contain lowercase letters a-z, digits 0-9, underscores _, dashes -, asterisks *, and forward slashes /. For multi-tenant vendor scenarios, an at sign (@) can be used to prefix the vendor name. The tenant id (before the '@') is limited to 240 characters and the vendor id is limited to 13 characters. If in the multi-tenant vendor format, then the first character may additionally be numeric.
key
,
String
the value for the Entry to be added.
value
)

Implements io.opentelemetry.api.trace.TraceStateBuilder.put.

Allows key value pairs to be added to the TraceState.

public TraceStateBuilder
remove(String
the key for the Entry to be removed.
key
)

Implements io.opentelemetry.api.trace.TraceStateBuilder.remove.

Removes the Entry that has the given key if it is present.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

EMPTYback to summary
private static final ArrayBasedTraceState EMPTY
KEY_MAX_SIZEback to summary
private static final int KEY_MAX_SIZE
MAX_ENTRIESback to summary
private static final int MAX_ENTRIES
MAX_TENANT_ID_SIZEback to summary
private static final int MAX_TENANT_ID_SIZE
MAX_VENDOR_ID_SIZEback to summary
private static final int MAX_VENDOR_ID_SIZE
numEntriesback to summary
pack-priv int numEntries
reversedEntriesback to summary
private final List<String> reversedEntries
VALUE_MAX_SIZEback to summary
private static final int VALUE_MAX_SIZE

Constructor Detail

ArrayBasedTraceStateBuilderback to summary
pack-priv ArrayBasedTraceStateBuilder()
ArrayBasedTraceStateBuilderback to summary
pack-priv ArrayBasedTraceStateBuilder(ArrayBasedTraceState parent)

Method Detail

buildback to summary
public TraceState build()

Implements io.opentelemetry.api.trace.TraceStateBuilder.build.

Doc from io.opentelemetry.api.trace.TraceStateBuilder.build.

Builds a TraceState by adding the entries to the parent in front of the key-value pairs list and removing duplicate entries.

Returns:TraceState

a TraceState with the new entries.

Annotations
@Override
emptyback to summary
pack-priv static TraceState empty()
isKeyValidback to summary
private static boolean isKeyValid(String key)

Checks the validity of a key.

Parameters
key:String

is an opaque string up to 256 characters printable. It MUST begin with a lowercase letter, and can only contain lowercase letters a-z, digits 0-9, underscores _, dashes -, asterisks *, and forward slashes /. For multi-tenant vendor scenarios, an at sign (@) can be used to prefix the vendor name. The tenant id (before the '@') is limited to 240 characters and the vendor id is limited to 13 characters. If in the multi-tenant vendor format, then the first character may additionally be numeric.

Returns:boolean

boolean representing key validity

isNotDigitback to summary
private static boolean isNotDigit(char ch)
isNotLegalKeyCharacterback to summary
private static boolean isNotLegalKeyCharacter(char c)
isNotLowercaseLetterOrDigitback to summary
private static boolean isNotLowercaseLetterOrDigit(char ch)
isValueValidback to summary
private static boolean isValueValid(String value)
putback to summary
public TraceStateBuilder put(String key, String value)

Implements io.opentelemetry.api.trace.TraceStateBuilder.put.

Allows key value pairs to be added to the TraceState.

Parameters
key:String

is an opaque string up to 256 characters printable. It MUST begin with a lowercase letter, and can only contain lowercase letters a-z, digits 0-9, underscores _, dashes -, asterisks *, and forward slashes /. For multi-tenant vendor scenarios, an at sign (@) can be used to prefix the vendor name. The tenant id (before the '@') is limited to 240 characters and the vendor id is limited to 13 characters. If in the multi-tenant vendor format, then the first character may additionally be numeric.

value:String

Doc from io.opentelemetry.api.trace.TraceStateBuilder.put.

the value for the Entry to be added.

Returns:TraceStateBuilder

Doc from io.opentelemetry.api.trace.TraceStateBuilder.put.

this.

Annotations
@Override
removeback to summary
public TraceStateBuilder remove(String key)

Implements io.opentelemetry.api.trace.TraceStateBuilder.remove.

Doc from io.opentelemetry.api.trace.TraceStateBuilder.remove.

Removes the Entry that has the given key if it is present.

Parameters
key:String

the key for the Entry to be removed.

Returns:TraceStateBuilder

this.

Annotations
@Override