Class FixedValueParameterResolver<T>
java.lang.Object
org.axonframework.messaging.core.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.0
- Author:
- Allard Buijze
-
Constructor Summary
ConstructorsConstructorDescriptionFixedValueParameterResolver(T value) Initialize the ParameterResolver to inject the givenvaluefor each incoming message. -
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.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.axonframework.messaging.core.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:ParameterResolverAsynchronously resolves the parameter value from thecontext.- Specified by:
resolveParameterValuein interfaceParameterResolver<T>- 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<T>- Parameters:
context- The current processing context.- Returns:
- Returns
trueif this resolver can provide a value for the message, otherwisefalse.
-