Record Class TransformationContext
java.lang.Object
java.lang.Record
io.axoniq.framework.messaging.transformation.TransformationContext
- Record Components:
entryContext- theContextattached to the source message, carrying its position for use in diagnostics, nevernullprocessingContext- the active unit of work for this transformation, ornullwhen none is activeconverter- the converter used to convert the input payload to the transformation's input type, nevernullmessageTypeResolver- the resolver used to validate the transformed output's message type, nevernull
@Internal
public record TransformationContext(Context entryContext, @Nullable ProcessingContext processingContext, MessageConverter converter, MessageTypeResolver messageTypeResolver)
extends Record
Immutable per-invocation context handed to a
MessageTransformation when it transforms a
single message.
It groups two contexts with distinct roles. entryContext is the Context attached
to the source message. It is always present and, where the source provides one, carries the
message's position for use in diagnostics. processingContext is
the active unit of work for the transformation. It is present when the transformation runs inside
a unit of work, such as an entity load, and null when none is active, such as while an
event stream is being opened.
converter and messageTypeResolver are held as explicit fields rather than read
from processingContext, because that context is not always present.
- Since:
- 5.2.0
- Author:
- Laura Devriendt
-
Constructor Summary
ConstructorsConstructorDescriptionTransformationContext(Context entryContext, @Nullable ProcessingContext processingContext, MessageConverter converter, MessageTypeResolver messageTypeResolver) Creates an instance of aTransformationContextrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theconverterrecord component.Returns the value of theentryContextrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of themessageTypeResolverrecord component.@Nullable ProcessingContextReturns the value of theprocessingContextrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
TransformationContext
public TransformationContext(Context entryContext, @Nullable ProcessingContext processingContext, MessageConverter converter, MessageTypeResolver messageTypeResolver) Creates an instance of aTransformationContextrecord class.- Parameters:
entryContext- the value for theentryContextrecord componentprocessingContext- the value for theprocessingContextrecord componentconverter- the value for theconverterrecord componentmessageTypeResolver- the value for themessageTypeResolverrecord component
-
-
Method Details
-
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). -
entryContext
Returns the value of theentryContextrecord component.- Returns:
- the value of the
entryContextrecord component
-
processingContext
Returns the value of theprocessingContextrecord component.- Returns:
- the value of the
processingContextrecord component
-
converter
Returns the value of theconverterrecord component.- Returns:
- the value of the
converterrecord component
-
messageTypeResolver
Returns the value of themessageTypeResolverrecord component.- Returns:
- the value of the
messageTypeResolverrecord component
-