Package io.micronaut.tracing.brave
Record Class BravePropagationContext
java.lang.Object
java.lang.Record
io.micronaut.tracing.brave.BravePropagationContext
- Record Components:
currentTraceContext
- The correct trace contextcontext
- The trace context
- All Implemented Interfaces:
io.micronaut.core.propagation.PropagatedContextElement
,io.micronaut.core.propagation.ThreadPropagatedContextElement<brave.propagation.CurrentTraceContext.Scope>
@Internal
public record BravePropagationContext(brave.propagation.CurrentTraceContext currentTraceContext, brave.propagation.TraceContext context)
extends Record
implements io.micronaut.core.propagation.ThreadPropagatedContextElement<brave.propagation.CurrentTraceContext.Scope>
The Brave propagation context.
- Author:
- Denis Stepanov
-
Constructor Summary
ConstructorDescriptionBravePropagationContext
(brave.propagation.CurrentTraceContext currentTraceContext, brave.propagation.TraceContext context) Creates an instance of aBravePropagationContext
record class. -
Method Summary
Modifier and TypeMethodDescriptionbrave.propagation.TraceContext
context()
Returns the value of thecontext
record component.brave.propagation.CurrentTraceContext
Returns the value of thecurrentTraceContext
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.void
restoreThreadContext
(brave.propagation.CurrentTraceContext.Scope oldScope) final String
toString()
Returns a string representation of this record class.brave.propagation.CurrentTraceContext.Scope
-
Constructor Details
-
BravePropagationContext
public BravePropagationContext(brave.propagation.CurrentTraceContext currentTraceContext, brave.propagation.TraceContext context) Creates an instance of aBravePropagationContext
record class.- Parameters:
currentTraceContext
- the value for thecurrentTraceContext
record componentcontext
- the value for thecontext
record component
-
-
Method Details
-
updateThreadContext
public brave.propagation.CurrentTraceContext.Scope updateThreadContext()- Specified by:
updateThreadContext
in interfaceio.micronaut.core.propagation.ThreadPropagatedContextElement<brave.propagation.CurrentTraceContext.Scope>
-
restoreThreadContext
public void restoreThreadContext(brave.propagation.CurrentTraceContext.Scope oldScope) - Specified by:
restoreThreadContext
in interfaceio.micronaut.core.propagation.ThreadPropagatedContextElement<brave.propagation.CurrentTraceContext.Scope>
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object)
. -
currentTraceContext
public brave.propagation.CurrentTraceContext currentTraceContext()Returns the value of thecurrentTraceContext
record component.- Returns:
- the value of the
currentTraceContext
record component
-
context
public brave.propagation.TraceContext context()Returns the value of thecontext
record component.- Returns:
- the value of the
context
record component
-