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>

public class FixedValueParameterResolver<T> extends Object implements 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 Details

    • FixedValueParameterResolver

      public FixedValueParameterResolver(T value)
      Initialize the ParameterResolver to inject the given value for each incoming message.
      Parameters:
      value - The value to inject as parameter
  • Method Details

    • resolveParameterValue

      public T resolveParameterValue(Message message)
      Description copied from interface: ParameterResolver
      Resolves the parameter value to use for the given message, or null if no suitable parameter value can be resolved.
      Specified by:
      resolveParameterValue in interface ParameterResolver<T>
      Parameters:
      message - The message to resolve the value from
      Returns:
      the parameter value for the handler
    • matches

      public boolean matches(Message message)
      Description copied from interface: ParameterResolver
      Indicates whether this resolver is capable of providing a value for the given message.
      Specified by:
      matches in interface ParameterResolver<T>
      Parameters:
      message - The message to evaluate
      Returns:
      true if this resolver can provide a value for the message, otherwise false