Class ActionMapper.Builder

java.lang.Object
discord4j.common.store.api.ActionMapper.Builder
Enclosing class:
ActionMapper

public static class ActionMapper.Builder extends Object
  • Method Details

    • map

      public <R, S extends StoreAction<R>> ActionMapper.Builder map(Class<S> actionType, Function<? super S,? extends Publisher<R>> handler)
      Maps a specific action type to a handler function to execute.
      Type Parameters:
      R - the return type of the action
      S - the type of the action itself
      Parameters:
      actionType - the type of the action
      handler - the handler to execute when an action of the specified type is received
      Returns:
      this ActionMapper.Builder enriched with the added mapping
    • build

      public ActionMapper build()
      Builds an ActionMapper with all declared mappings.
      Returns:
      a new ActionMapper