Class PayloadParameterResolver
java.lang.Object
org.axonframework.messaging.core.annotation.PayloadParameterResolver
- All Implemented Interfaces:
ParameterResolver<Object>
Implementation of a
ParameterResolver that resolves the Message payload as parameter in a handler method.- Since:
- 3.0.0
- Author:
- Allard Buijze
-
Constructor Summary
ConstructorsConstructorDescriptionPayloadParameterResolver(Class<?> payloadType) Initializes a newPayloadParameterResolverfor a method parameter of givenpayloadType. -
Method Summary
Modifier and TypeMethodDescriptionbooleanmatches(ProcessingContext context) Indicates whether this resolver is capable of providing a value for the givencontext.resolveParameterValue(ProcessingContext context) Asynchronously resolves the parameter value from thecontext.Class<?> Returns the class of the payload that is supported by this resolver.
-
Constructor Details
-
PayloadParameterResolver
Initializes a newPayloadParameterResolverfor a method parameter of givenpayloadType. This parameter resolver matches with a message if the payload of the message is assignable to the givenpayloadType.- Parameters:
payloadType- the parameter type
-
-
Method Details
-
resolveParameterValue
Description copied from interface:ParameterResolverAsynchronously resolves the parameter value from thecontext.- Specified by:
resolveParameterValuein interfaceParameterResolver<Object>- Parameters:
context- The current processing context.- Returns:
- A
CompletableFuturethat will complete with the parameter value, or completes withnull.
-
matches
Description copied from interface:ParameterResolverIndicates whether this resolver is capable of providing a value for the givencontext.- Specified by:
matchesin interfaceParameterResolver<Object>- Parameters:
context- The current processing context.- Returns:
- Returns
trueif this resolver can provide a value for the message, otherwisefalse.
-
supportedPayloadType
Description copied from interface:ParameterResolverReturns the class of the payload that is supported by this resolver. Defaults to theObjectclass indicating that the payload type is irrelevant for this resolver.- Specified by:
supportedPayloadTypein interfaceParameterResolver<Object>- Returns:
- The class of the payload that is supported by this resolver
-