Interface QueryResponseMessage
- All Superinterfaces:
Message,ResultMessage
- All Known Subinterfaces:
SubscriptionQueryUpdateMessage
- All Known Implementing Classes:
GenericQueryResponseMessage,GenericSubscriptionQueryUpdateMessage
A
ResultMessage implementation that contains the result of query handling.- Since:
- 3.2.0
- Author:
- Allard Buijze
-
Field Summary
Fields inherited from interface org.axonframework.messaging.core.Message
RESOURCE_KEY -
Method Summary
Modifier and TypeMethodDescriptionandMetadata(Map<String, String> additionalMetadata) default QueryResponseMessagewithConvertedPayload(Class<?> type, Converter converter) Returns a newMessageimplementation with itsMessage.payload()converted to the giventypeby the givenconverter.withConvertedPayload(Type type, Converter converter) Returns a newMessageimplementation with itsMessage.payload()converted to the giventypeby the givenconverter.default QueryResponseMessagewithConvertedPayload(TypeReference<?> type, Converter converter) Returns a newMessageimplementation with itsMessage.payload()converted to the giventypeby the givenconverter.withMetadata(Map<String, String> metadata) Returns a copy of thisMessage(implementation) with the givenmetadata.
-
Method Details
-
withMetadata
Description copied from interface:MessageReturns a copy of thisMessage(implementation) with the givenmetadata.All other fields, like for example the
Message.payload(), remain unchanged.While the implementation returned may be different from the implementation of
this, implementations must take special care in returning the same type ofMessageto prevent errors further downstream.- Specified by:
withMetadatain interfaceMessage- Specified by:
withMetadatain interfaceResultMessage- Parameters:
metadata- The new metadata for theMessage.- Returns:
- A copy of
this Message (implementation)with the givenmetadata.
-
andMetadata
Description copied from interface:MessageReturns a copy of thisMessage(implementation) with itsmetadatamerged with the givenmetadata.All other fields, like for example the
Message.payload(), remain unchanged.- Specified by:
andMetadatain interfaceMessage- Specified by:
andMetadatain interfaceResultMessage- Parameters:
additionalMetadata- The metadata to merge with.- Returns:
- A copy of
this Message (implementation)with the givenmetadata.
-
withConvertedPayload
@Nonnull default QueryResponseMessage withConvertedPayload(@Nonnull Class<?> type, @Nonnull Converter converter) Description copied from interface:MessageReturns a newMessageimplementation with itsMessage.payload()converted to the giventypeby the givenconverter. This newMessageis effectively a copy ofthis Messagewith a renewed payload andMessage.payloadType().Will return the
thisinstance if thepayload typeisassignable fromthe converted result.- Specified by:
withConvertedPayloadin interfaceMessage- Specified by:
withConvertedPayloadin interfaceResultMessage- Parameters:
type- The type to convert theMessage.payload()to.converter- The converter to convert theMessage.payload()with.- Returns:
- A new
Messageimplementation with itsMessage.payload()converted to the giventypeby the givenconverter.
-
withConvertedPayload
@Nonnull default QueryResponseMessage withConvertedPayload(@Nonnull TypeReference<?> type, @Nonnull Converter converter) Description copied from interface:MessageReturns a newMessageimplementation with itsMessage.payload()converted to the giventypeby the givenconverter. This newMessageis effectively a copy ofthis Messagewith a renewed payload andMessage.payloadType().Will return the
thisinstance if thepayload typeisassignable fromthe converted result.- Specified by:
withConvertedPayloadin interfaceMessage- Specified by:
withConvertedPayloadin interfaceResultMessage- Parameters:
type- The type to convert theMessage.payload()to.converter- The converter to convert theMessage.payload()with.- Returns:
- A new
Messageimplementation with itsMessage.payload()converted to the giventypeby the givenconverter.
-
withConvertedPayload
@Nonnull QueryResponseMessage withConvertedPayload(@Nonnull Type type, @Nonnull Converter converter) Description copied from interface:MessageReturns a newMessageimplementation with itsMessage.payload()converted to the giventypeby the givenconverter. This newMessageis effectively a copy ofthis Messagewith a renewed payload andMessage.payloadType().Will return the
thisinstance if thepayload typeisassignable fromthe converted result.- Specified by:
withConvertedPayloadin interfaceMessage- Specified by:
withConvertedPayloadin interfaceResultMessage- Parameters:
type- The type to convert theMessage.payload()to.converter- The converter to convert theMessage.payload()with.- Returns:
- A new
Messageimplementation with itsMessage.payload()converted to the giventypeby the givenconverter.
-