Record Class ObservationPropagationContext
java.lang.Object
java.lang.Record
io.micronaut.micrometer.observation.ObservationPropagationContext
- Record Components:
observation
- TheObservation
- 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
ConstructorDescriptionObservationPropagationContext
(io.micrometer.observation.Observation observation) Creates an instance of aObservationPropagationContext
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.io.micrometer.observation.Observation
Returns the value of theobservation
record component.void
restoreThreadContext
(io.micrometer.observation.Observation.Scope oldScope) final String
toString()
Returns a string representation of this record class.io.micrometer.observation.Observation.Scope
-
Constructor Details
-
ObservationPropagationContext
public ObservationPropagationContext(io.micrometer.observation.Observation observation) Creates an instance of aObservationPropagationContext
record class.- Parameters:
observation
- the value for theobservation
record component
-
-
Method Details
-
updateThreadContext
public io.micrometer.observation.Observation.Scope updateThreadContext()- Specified by:
updateThreadContext
in interfaceio.micronaut.core.propagation.ThreadPropagatedContextElement<io.micrometer.observation.Observation.Scope>
-
restoreThreadContext
public void restoreThreadContext(io.micrometer.observation.Observation.Scope oldScope) - Specified by:
restoreThreadContext
in interfaceio.micronaut.core.propagation.ThreadPropagatedContextElement<io.micrometer.observation.Observation.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)
. -
observation
public io.micrometer.observation.Observation observation()Returns the value of theobservation
record component.- Returns:
- the value of the
observation
record component
-