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 Type
    Method
    Description
    void
    handleReturnType(BotRequest botRequest, BotResponse botResponse, Object returnValue)
    Processes the return value produced by a handler method and records any resulting API methods in the response.
    boolean
    Determines whether this handler can process the return type of the given method.
  • Method Details

    • supportsReturnType

      boolean supportsReturnType(Method method)
      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 be null
      Returns:
      true if this handler supports the method's return type, false otherwise
    • handleReturnType

      void handleReturnType(BotRequest botRequest, BotResponse botResponse, Object returnValue)
      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 be null
      botResponse - the mutable response to which API calls should be added; must not be null
      returnValue - the value returned by the handler method; may be null for void methods