public static class ReplicatedEntity.CommandHandlerFactories<Command,Event,State>
extends java.lang.Object
CommandHandler defines how to react on a commands and optionally functions for other signals,
e.g. Termination messages if watch is used.
Note that you can have different handlers based on current state by using
CommandHandler.byState.
Instances available through ReplicatedEntity.CommandHandler
Not for user extension.
| Constructor and Description |
|---|
CommandHandlerFactories() |
| Modifier and Type | Method and Description |
|---|---|
ReplicatedEntity.CommandHandler<Command,Event,State> |
apply(scala.Function3<ReplicatedEntity.CommandContext,State,Command,Effect<Event,State>> commandHandler) |
ReplicatedEntity.CommandHandler<Command,Event,State> |
byState(scala.Function1<State,ReplicatedEntity.CommandHandler<Command,Event,State>> choice)
Select different handlers based on current state.
|
ReplicatedEntity.CommandHandler<Command,Event,State> |
command(scala.Function1<Command,Effect<Event,State>> commandHandler)
Convenience for simple commands that don't need the state and context.
|
public final ReplicatedEntity.CommandHandler<Command,Event,State> apply(scala.Function3<ReplicatedEntity.CommandContext,State,Command,Effect<Event,State>> commandHandler)
public final ReplicatedEntity.CommandHandler<Command,Event,State> byState(scala.Function1<State,ReplicatedEntity.CommandHandler<Command,Event,State>> choice)
choice - (undocumented)