Package io.micronaut.chatbots.core
Class DefaultDispatcher<B extends BotConfiguration,I,O>
- java.lang.Object
-
- io.micronaut.chatbots.core.DefaultDispatcher<B,I,O>
-
- Type Parameters:
B
- The Bot configurationI
- input type.O
- output type.
- All Implemented Interfaces:
Dispatcher<B,I,O>
@Singleton public class DefaultDispatcher<B extends BotConfiguration,I,O> extends java.lang.Object implements Dispatcher<B,I,O>
Iterates through everyHandler
in odered and dispatch the message to the first which can handle the request.- Since:
- 1.0.0
- Author:
- Sergio del Amo
-
-
Constructor Summary
Constructors Constructor Description DefaultDispatcher(java.util.List<Handler<B,I,O>> handlers)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Optional<O>
dispatch(B bot, I input)
-
-
-
Method Detail
-
dispatch
@NonNull public java.util.Optional<O> dispatch(@Nullable B bot, @NonNull @NotNull I input)
- Specified by:
dispatch
in interfaceDispatcher<B extends BotConfiguration,I,O>
-
-