Record Class MdcPropagationContext
java.lang.Object
java.lang.Record
io.micronaut.context.propagation.slf4j.MdcPropagationContext
- Record Components:
state- The MDC state as map
- All Implemented Interfaces:
PropagatedContextElement, ThreadPropagatedContextElement<Map<String,String>>
-
Constructor Summary
ConstructorsConstructorDescriptionMdcPropagationContext(Map<String, String> state) Creates an instance of aMdcPropagationContextrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.voidrestoreThreadContext(@Nullable Map<String, String> oldState) Restore the state on the propagation exit.state()Returns the value of thestaterecord component.final StringtoString()Returns a string representation of this record class.Update the thread context on the propagation entry and return the state that will be used for the restore on the propagation exit.
-
Constructor Details
-
MdcPropagationContext
public MdcPropagationContext() -
MdcPropagationContext
-
-
Method Details
-
updateThreadContext
Description copied from interface:ThreadPropagatedContextElementUpdate the thread context on the propagation entry and return the state that will be used for the restore on the propagation exit.- Specified by:
updateThreadContextin interfaceThreadPropagatedContextElement<Map<String,String>> - Returns:
- The state to be restored
-
restoreThreadContext
Description copied from interface:ThreadPropagatedContextElementRestore the state on the propagation exit.- Specified by:
restoreThreadContextin interfaceThreadPropagatedContextElement<Map<String,String>> - Parameters:
oldState- The state to be restored
-
toString
-
hashCode
-
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). -
state
-