Package io.micronaut.chatbots.core
Interface Handler<B extends BotConfiguration,I,O>
-
- Type Parameters:
B
- The Bot configurationI
- input type.O
- output type.
- All Superinterfaces:
io.micronaut.core.order.Ordered
- All Known Subinterfaces:
BasecampHandler
,TelegramHandler<O>
- All Known Implementing Classes:
CommandHandler
public interface Handler<B extends BotConfiguration,I,O> extends io.micronaut.core.order.Ordered
Request handlers are responsible for handling one or more types of incoming requests.- Since:
- 1.0.0
- Author:
- Sergio del Amo
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
canHandle(B bot, I input)
Returns true if the handler can dispatch the current request.java.util.Optional<O>
handle(B bot, I input)
Handles the request.
-
-
-
Method Detail
-
canHandle
boolean canHandle(@Nullable B bot, @NonNull @NotNull I input)
Returns true if the handler can dispatch the current request.- Parameters:
bot
- bot being asked to handle this commandinput
- input to the request handler- Returns:
- true if the handler is capable of handling the current request
-
-