Class DefaultDispatcher<B extends BotConfiguration,​I,​O>

  • Type Parameters:
    B - The Bot configuration
    I - 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 every Handler in odered and dispatch the message to the first which can handle the request.
    Since:
    1.0.0
    Author:
    Sergio del Amo
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Optional<O> dispatch​(B bot, I input)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DefaultDispatcher

        public DefaultDispatcher​(java.util.List<Handler<B,​I,​O>> handlers)