Class TypedParameterResolver<M>

java.lang.Object
io.fluxzero.common.handling.TypedParameterResolver<M>
Type Parameters:
M - the message or context type used for resolution (e.g. HasMessage, Object, etc.)
All Implemented Interfaces:
ParameterResolver<M>

public abstract class TypedParameterResolver<M> extends Object implements ParameterResolver<M>
Abstract base class for ParameterResolvers that resolve parameters based on type matching.

This class provides a default matches(java.lang.reflect.Parameter, java.lang.annotation.Annotation, M) implementation that checks whether the expected type of the parameter is assignable from a configured base type.

  • Constructor Details

    • TypedParameterResolver

      public TypedParameterResolver()
  • Method Details

    • matches

      public boolean matches(Parameter parameter, Annotation methodAnnotation, M value)
      Determines whether the given parameter is eligible to be resolved by this resolver.

      This default implementation matches if parameter.getType() is assignable from the configured base type.

      Specified by:
      matches in interface ParameterResolver<M>
      Parameters:
      parameter - the method parameter to resolve
      methodAnnotation - the annotation on the method (if any)
      value - the current message or context object
      Returns:
      true if this resolver can resolve the parameter