Record Class ObservationPropagationContext

java.lang.Object
java.lang.Record
io.micronaut.micrometer.observation.ObservationPropagationContext
Record Components:
observation - The Observation
All Implemented Interfaces:
io.micronaut.core.propagation.PropagatedContextElement, io.micronaut.core.propagation.ThreadPropagatedContextElement<io.micrometer.observation.Observation.Scope>

@Internal public record ObservationPropagationContext(io.micrometer.observation.Observation observation) extends Record implements io.micronaut.core.propagation.ThreadPropagatedContextElement<io.micrometer.observation.Observation.Scope>
Observation propagated context.
  • Constructor Summary

    Constructors
    Constructor
    Description
    ObservationPropagationContext(io.micrometer.observation.Observation observation)
    Creates an instance of a ObservationPropagationContext record class.
  • Method Summary

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

    Methods inherited from class java.lang.Object

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

    • ObservationPropagationContext

      public ObservationPropagationContext(io.micrometer.observation.Observation observation)
      Creates an instance of a ObservationPropagationContext record class.
      Parameters:
      observation - the value for the observation record component
  • Method Details

    • updateThreadContext

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

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

      public io.micrometer.observation.Observation observation()
      Returns the value of the observation record component.
      Returns:
      the value of the observation record component