Package io.opentelemetry.api.trace
Class ArrayBasedTraceState
- java.lang.Object
-
- io.opentelemetry.api.trace.ArrayBasedTraceState
-
- All Implemented Interfaces:
TraceState
- Direct Known Subclasses:
AutoValue_ArrayBasedTraceState
@Immutable abstract class ArrayBasedTraceState extends java.lang.Object implements TraceState
-
-
Constructor Summary
Constructors Constructor Description ArrayBasedTraceState()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.util.Map<java.lang.String,java.lang.String>
asMap()
Returns a read-only view of thisTraceState
as aMap
.(package private) static ArrayBasedTraceState
create(java.util.List<java.lang.String> entries)
void
forEach(java.util.function.BiConsumer<java.lang.String,java.lang.String> consumer)
Iterates over all the key-value entries contained in thisTraceState
.java.lang.String
get(java.lang.String key)
Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key.(package private) abstract java.util.List<java.lang.String>
getEntries()
boolean
isEmpty()
Returns whether thisTraceState
is empty, containing no entries.int
size()
Returns the number of entries in thisTraceState
.TraceStateBuilder
toBuilder()
Returns aBuilder
based on thisTraceState
.
-
-
-
Method Detail
-
get
@Nullable public java.lang.String get(java.lang.String key)
Description copied from interface:TraceState
Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key.- Specified by:
get
in interfaceTraceState
- Parameters:
key
- with which the specified value is to be associated- Returns:
- the value to which the specified key is mapped, or null if this map contains no mapping for the key.
-
size
public int size()
Description copied from interface:TraceState
Returns the number of entries in thisTraceState
.- Specified by:
size
in interfaceTraceState
-
isEmpty
public boolean isEmpty()
Description copied from interface:TraceState
Returns whether thisTraceState
is empty, containing no entries.- Specified by:
isEmpty
in interfaceTraceState
-
forEach
public void forEach(java.util.function.BiConsumer<java.lang.String,java.lang.String> consumer)
Description copied from interface:TraceState
Iterates over all the key-value entries contained in thisTraceState
.- Specified by:
forEach
in interfaceTraceState
-
asMap
public java.util.Map<java.lang.String,java.lang.String> asMap()
Description copied from interface:TraceState
Returns a read-only view of thisTraceState
as aMap
.- Specified by:
asMap
in interfaceTraceState
-
getEntries
abstract java.util.List<java.lang.String> getEntries()
-
toBuilder
public TraceStateBuilder toBuilder()
Description copied from interface:TraceState
Returns aBuilder
based on thisTraceState
.- Specified by:
toBuilder
in interfaceTraceState
- Returns:
- a
Builder
based on thisTraceState
.
-
create
static ArrayBasedTraceState create(java.util.List<java.lang.String> entries)
-
-