Class PayloadParameterResolver
java.lang.Object
org.axonframework.messaging.annotation.PayloadParameterResolver
- All Implemented Interfaces:
ParameterResolver
Implementation of a
ParameterResolver that resolves the Message payload as parameter in a handler method.-
Constructor Summary
ConstructorsConstructorDescriptionPayloadParameterResolver(Class<?> payloadType) Initializes a newPayloadParameterResolverfor a method parameter of givenpayloadType. -
Method Summary
Modifier and TypeMethodDescriptionbooleanIndicates whether this resolver is capable of providing a value for the givenmessage.resolveParameterValue(Message message) Resolves the parameter value to use for the givenmessage, ornullif no suitable parameter value can be resolved.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:ParameterResolverResolves the parameter value to use for the givenmessage, ornullif no suitable parameter value can be resolved.- Specified by:
resolveParameterValuein interfaceParameterResolver- Parameters:
message- The message to resolve the value from- Returns:
- the parameter value for the handler
-
matches
Description copied from interface:ParameterResolverIndicates whether this resolver is capable of providing a value for the givenmessage.- Specified by:
matchesin interfaceParameterResolver- Parameters:
message- The message to evaluate- 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- Returns:
- The class of the payload that is supported by this resolver
-