Interface BotReturnTypeHandler
public interface BotReturnTypeHandler
Strategy interface for processing the value returned by a handler method.
Implementations translate specific return types (e.g.,
BotApiMethod,
Collection, or custom types) into BotResponse
entries that are later executed by the framework.- Since:
- 0.0.1
- Author:
- Islom Mirsaburov
-
Method Summary
Modifier and TypeMethodDescriptionvoidhandleReturnType(BotRequest botRequest, BotResponse botResponse, Object returnValue) Processes the return value produced by a handler method and records any resulting API methods in the response.booleansupportsReturnType(Method method) Determines whether this handler can process the return type of the given method.
-
Method Details
-
supportsReturnType
Determines whether this handler can process the return type of the given method.- Parameters:
method- the handler method whose return type is being inspected; must not benull- Returns:
trueif this handler supports the method's return type,falseotherwise
-
handleReturnType
Processes the return value produced by a handler method and records any resulting API methods in the response.- Parameters:
botRequest- the current request context; must not benullbotResponse- the mutable response to which API calls should be added; must not benullreturnValue- the value returned by the handler method; may benullfor void methods
-