Package discord4j.common.store.api
Class ActionMapper.Builder
- java.lang.Object
-
- discord4j.common.store.api.ActionMapper.Builder
-
- Enclosing class:
- ActionMapper
public static class ActionMapper.Builder extends Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ActionMapperbuild()Builds anActionMapperwith all declared mappings.<R,S extends StoreAction<R>>
ActionMapper.Buildermap(Class<S> actionType, Function<? super S,? extends Publisher<R>> handler)Maps a specific action type to a handler function to execute.
-
-
-
Method Detail
-
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 actionS- the type of the action itself- Parameters:
actionType- the type of the actionhandler- the handler to execute when an action of the specified type is received- Returns:
- this
ActionMapper.Builderenriched with the added mapping
-
build
public ActionMapper build()
Builds anActionMapperwith all declared mappings.- Returns:
- a new
ActionMapper
-
-