Interface MessageConverter
- All Superinterfaces:
Converter,DescribableComponent
- All Known Implementing Classes:
DelegatingMessageConverter
A converter specific for
Messages, acting on the payload.
This interface serves the purpose of enforcing use of the right type of converter. Implementation of this interface
typically delegate operations to a Converter instance.
- Since:
- 5.0.0
- Author:
- Steven van Beelen
-
Method Summary
Modifier and TypeMethodDescriptiondefault <M extends Message,T>
MconvertMessage(M message, Class<T> targetType) Converts the givenmessage'spayloadto the giventargetType, returning a newMessagewith the converted payload.<M extends Message>
MconvertMessage(M message, Type targetType) Converts the givenmessage'spayloadto the giventargetType, returning a newMessagewith the converted payload.default <M extends Message,T>
TconvertPayload(M message, Class<T> targetType) <M extends Message,T>
TconvertPayload(M message, Type targetType) Methods inherited from interface org.axonframework.conversion.Converter
canConvert, canConvert, convert, convertMethods inherited from interface org.axonframework.common.infra.DescribableComponent
describeTo
-
Method Details
-
convertPayload
-
convertPayload
-
convertMessage
@Nonnull default <M extends Message,T> M convertMessage(@Nonnull M message, @Nonnull Class<T> targetType) Converts the givenmessage'spayloadto the giventargetType, returning a newMessagewith the converted payload.- Type Parameters:
M- The type ofMessageto convert and return.T- The target data type.- Parameters:
message- TheMessageto convert thepayloadfor.targetType- The type to convert thepayloadinto.- Returns:
- A new
Messagecontaining the converted version of the givenmessage'spayloadinto the giventargetType.
-
convertMessage
Converts the givenmessage'spayloadto the giventargetType, returning a newMessagewith the converted payload.
-