org.axonframework.common.annotation
Class FixedValueParameterResolver<T>

java.lang.Object
  extended by org.axonframework.common.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 Summary
FixedValueParameterResolver(T value)
          Initialize the ParameterResolver to inject the given value for each incoming message.
 
Method Summary
 boolean matches(Message message)
          Indicates whether this resolver is capable of providing a value for the given message.
 T resolveParameterValue(Message message)
          Resolves the parameter value to use for the given message, or null if no suitable parameter value can be resolved.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

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 Detail

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


Copyright © 2010-2016. All Rights Reserved.