Class FixedValueParameterResolver<T>
java.lang.Object
org.axonframework.messaging.annotation.FixedValueParameterResolver<T>
- Type Parameters:
T- The type of value resolved by this parameter
- All Implemented Interfaces:
ParameterResolver<T>
ParameterResolver implementation that injects a fixed value. Useful for injecting parameter values that do not rely
on information contained in the incoming message itself.
- Since:
- 2.0
- Author:
- Allard Buijze
-
Constructor Summary
ConstructorsConstructorDescriptionFixedValueParameterResolver(T value) Initialize the ParameterResolver to inject the givenvaluefor each incoming message. -
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.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.axonframework.messaging.annotation.ParameterResolver
supportedPayloadType
-
Constructor Details
-
FixedValueParameterResolver
Initialize the ParameterResolver to inject the givenvaluefor each incoming message.- Parameters:
value- The value to inject as parameter
-
-
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<T>- 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<T>- Parameters:
message- The message to evaluate- Returns:
trueif this resolver can provide a value for the message, otherwisefalse
-