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 thisTraceStateas aMap.(package private) static ArrayBasedTraceStatecreate(java.util.List<java.lang.String> entries)voidforEach(java.util.function.BiConsumer<java.lang.String,java.lang.String> consumer)Iterates over all the key-value entries contained in thisTraceState.java.lang.Stringget(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()booleanisEmpty()Returns whether thisTraceStateis empty, containing no entries.intsize()Returns the number of entries in thisTraceState.TraceStateBuildertoBuilder()Returns aBuilderbased on thisTraceState.
-
-
-
Method Detail
-
get
@Nullable public java.lang.String get(java.lang.String key)
Description copied from interface:TraceStateReturns the value to which the specified key is mapped, or null if this map contains no mapping for the key.- Specified by:
getin 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:TraceStateReturns the number of entries in thisTraceState.- Specified by:
sizein interfaceTraceState
-
isEmpty
public boolean isEmpty()
Description copied from interface:TraceStateReturns whether thisTraceStateis empty, containing no entries.- Specified by:
isEmptyin interfaceTraceState
-
forEach
public void forEach(java.util.function.BiConsumer<java.lang.String,java.lang.String> consumer)
Description copied from interface:TraceStateIterates over all the key-value entries contained in thisTraceState.- Specified by:
forEachin interfaceTraceState
-
asMap
public java.util.Map<java.lang.String,java.lang.String> asMap()
Description copied from interface:TraceStateReturns a read-only view of thisTraceStateas aMap.- Specified by:
asMapin interfaceTraceState
-
getEntries
abstract java.util.List<java.lang.String> getEntries()
-
toBuilder
public TraceStateBuilder toBuilder()
Description copied from interface:TraceStateReturns aBuilderbased on thisTraceState.- Specified by:
toBuilderin interfaceTraceState- Returns:
- a
Builderbased on thisTraceState.
-
create
static ArrayBasedTraceState create(java.util.List<java.lang.String> entries)
-
-