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>

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.0
Author:
Allard Buijze
  • Constructor Details

    • FixedValueParameterResolver

      public FixedValueParameterResolver(@Nonnull 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

      @Nonnull public CompletableFuture<T> resolveParameterValue(@Nonnull ProcessingContext context)
      Description copied from interface: ParameterResolver
      Asynchronously resolves the parameter value from the context.
      Specified by:
      resolveParameterValue in interface ParameterResolver<T>
      Parameters:
      context - The current processing context.
      Returns:
      A CompletableFuture that will complete with the parameter value, or completes with null.
    • matches

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