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 TypeMethodDescriptionresolveArgument(Parameter parameter, BotRequest botRequest, BotResponse botResponse) Resolves and returns the argument value to be injected for the given method parameter.booleansupportsParameter(Parameter parameter) Determines whether this resolver can provide a value for the given method parameter.
-
Method Details
-
supportsParameter
Determines whether this resolver can provide a value for the given method parameter.- Parameters:
parameter- the method parameter to evaluate; must not benull- Returns:
trueif this resolver can resolve the parameter,falseotherwise
-
resolveArgument
Resolves and returns the argument value to be injected for the given method parameter. Called only whensupportsParameter(Parameter)returnedtrue.- Parameters:
parameter- the method parameter for which an argument is needed; must not benullbotRequest- the current request context providing access to the update and client; must not benullbotResponse- the mutable response object for the current request; must not benull- Returns:
- the resolved argument value, or
nullif the parameter is optional and not present
-