public class TelegramInvocableHandlerMethod extends HandlerMethod
HandlerMethod that invokes the underlying method with argument values resolved from the current
telegram request through a list of BotHandlerMethodArgumentResolver and then resolves the return value with a
list of BotHandlerMethodReturnValueHandler.| Constructor and Description |
|---|
TelegramInvocableHandlerMethod(@NotNull HandlerMethod handlerMethod,
@NotNull BotHandlerMethodArgumentResolver argumentResolver,
@NotNull BotHandlerMethodReturnValueHandler returnValueHandler)
Create an instance from a bean instance and a method.
|
| Modifier and Type | Method and Description |
|---|---|
com.pengrad.telegrambot.request.BaseRequest |
invokeAndHandle(@NotNull TelegramRequest telegramRequest,
@NotNull TelegramSession telegramSession)
Invoke
TelegramInvocableHandlerMethod with given arguments and return result. |
getReturnValue, toStringpublic TelegramInvocableHandlerMethod(@NotNull
@NotNull HandlerMethod handlerMethod,
@NotNull
@NotNull BotHandlerMethodArgumentResolver argumentResolver,
@NotNull
@NotNull BotHandlerMethodReturnValueHandler returnValueHandler)
handlerMethod - method to invokeargumentResolver - resolvers list to resolve argumentsreturnValueHandler - handlers list to handle return valuepublic com.pengrad.telegrambot.request.BaseRequest invokeAndHandle(@NotNull
@NotNull TelegramRequest telegramRequest,
@NotNull
@NotNull TelegramSession telegramSession)
throws IllegalStateException
TelegramInvocableHandlerMethod with given arguments and return result.telegramRequest - requesttelegramSession - current sessionIllegalStateException - when it failed to execute the handler method correctlyCopyright © 2022. All rights reserved.