Record Class OpenTelemetryPropagationContext

java.lang.Object
java.lang.Record
io.micronaut.tracing.opentelemetry.OpenTelemetryPropagationContext
Record Components:
context - The context
All Implemented Interfaces:
io.micronaut.core.propagation.PropagatedContextElement, io.micronaut.core.propagation.ThreadPropagatedContextElement<io.opentelemetry.context.Scope>

@Internal public record OpenTelemetryPropagationContext(io.opentelemetry.context.Context context) extends Record implements io.micronaut.core.propagation.ThreadPropagatedContextElement<io.opentelemetry.context.Scope>
Open telemetry propagated context.
Author:
Denis Stepanov
  • Constructor Summary

    Constructors
    Constructor
    Description
    OpenTelemetryPropagationContext(io.opentelemetry.context.Context context)
    Creates an instance of a OpenTelemetryPropagationContext record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    io.opentelemetry.context.Context
    Returns the value of the context 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(io.opentelemetry.context.Scope oldScope)
     
    final String
    Returns a string representation of this record class.
    io.opentelemetry.context.Scope
     

    Methods inherited from class java.lang.Object

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

    • OpenTelemetryPropagationContext

      public OpenTelemetryPropagationContext(io.opentelemetry.context.Context context)
      Creates an instance of a OpenTelemetryPropagationContext record class.
      Parameters:
      context - the value for the context record component
  • Method Details

    • updateThreadContext

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

      public void restoreThreadContext(io.opentelemetry.context.Scope oldScope)
      Specified by:
      restoreThreadContext in interface io.micronaut.core.propagation.ThreadPropagatedContextElement<io.opentelemetry.context.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.
    • context

      public io.opentelemetry.context.Context context()
      Returns the value of the context record component.
      Returns:
      the value of the context record component