Record Class BravePropagationContext

java.lang.Object
java.lang.Record
io.micronaut.tracing.brave.BravePropagationContext
Record Components:
currentTraceContext - The correct trace context
context - 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

    Constructors
    Constructor
    Description
    BravePropagationContext(brave.propagation.CurrentTraceContext currentTraceContext, brave.propagation.TraceContext context)
    Creates an instance of a BravePropagationContext record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    brave.propagation.TraceContext
    Returns the value of the context record component.
    brave.propagation.CurrentTraceContext
    Returns the value of the currentTraceContext record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    void
    restoreThreadContext(brave.propagation.CurrentTraceContext.Scope oldScope)
     
    final String
    Returns a string representation of this record class.
    brave.propagation.CurrentTraceContext.Scope
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • BravePropagationContext

      public BravePropagationContext(brave.propagation.CurrentTraceContext currentTraceContext, brave.propagation.TraceContext context)
      Creates an instance of a BravePropagationContext record class.
      Parameters:
      currentTraceContext - the value for the currentTraceContext record component
      context - the value for the context record component
  • Method Details

    • updateThreadContext

      public brave.propagation.CurrentTraceContext.Scope updateThreadContext()
      Specified by:
      updateThreadContext in interface io.micronaut.core.propagation.ThreadPropagatedContextElement<brave.propagation.CurrentTraceContext.Scope>
    • restoreThreadContext

      public void restoreThreadContext(brave.propagation.CurrentTraceContext.Scope oldScope)
      Specified by:
      restoreThreadContext in interface io.micronaut.core.propagation.ThreadPropagatedContextElement<brave.propagation.CurrentTraceContext.Scope>
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • currentTraceContext

      public brave.propagation.CurrentTraceContext currentTraceContext()
      Returns the value of the currentTraceContext record component.
      Returns:
      the value of the currentTraceContext record component
    • context

      public brave.propagation.TraceContext context()
      Returns the value of the context record component.
      Returns:
      the value of the context record component