Package discord4j.common.store.api
Class ActionMapper.Builder
java.lang.Object
discord4j.common.store.api.ActionMapper.Builder
- Enclosing class:
- ActionMapper
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds anActionMapper
with all declared mappings.<R,
S extends StoreAction<R>>
ActionMapper.BuilderMaps a specific action type to a handler function to execute.
-
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 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.Builder
enriched with the added mapping
-
build
Builds anActionMapper
with all declared mappings.- Returns:
- a new
ActionMapper
-