Interface BotArgumentResolver


public interface BotArgumentResolver
Strategy interface for resolving individual handler method parameters from the current request context. Each implementation handles a specific parameter type or annotation (e.g., injecting the current Update or a custom value extracted from the incoming message). The framework queries all registered resolvers via supportsParameter(Parameter) and delegates to the first matching resolver's resolveArgument(Parameter, BotRequest, BotResponse) to obtain the value.
Since:
0.0.1
Author:
Islom Mirsaburov
  • Method Summary

    Modifier and Type
    Method
    Description
    resolveArgument(Parameter parameter, BotRequest botRequest, BotResponse botResponse)
    Resolves and returns the argument value to be injected for the given method parameter.
    boolean
    Determines whether this resolver can provide a value for the given method parameter.
  • Method Details

    • supportsParameter

      boolean supportsParameter(Parameter parameter)
      Determines whether this resolver can provide a value for the given method parameter.
      Parameters:
      parameter - the method parameter to evaluate; must not be null
      Returns:
      true if this resolver can resolve the parameter, false otherwise
    • resolveArgument

      Object resolveArgument(Parameter parameter, BotRequest botRequest, BotResponse botResponse)
      Resolves and returns the argument value to be injected for the given method parameter. Called only when supportsParameter(Parameter) returned true.
      Parameters:
      parameter - the method parameter for which an argument is needed; must not be null
      botRequest - the current request context providing access to the update and client; must not be null
      botResponse - the mutable response object for the current request; must not be null
      Returns:
      the resolved argument value, or null if the parameter is optional and not present