Build a command handler from the appended cases.
Build a command handler from the appended cases. The returned handler will throw a scala.MatchError if applied to a command that has no defined match.
The builder is reset to empty after build has been called.
Match any command
Match any command
Builds and returns the handler since this will not let through any command to subsequent match statements
Match any command which is an instance or a subtype of commandClass
and which the given predicate
returns true for.
Match any command which is an instance or a subtype of commandClass
and which the given predicate
returns true for.
Throws java.lang.IllegalArgumentException
if commandClass
is not a subtype of the root Command
this builder was created with
Match any command which is an instance or a subtype of commandClass
Match any command which is an instance or a subtype of commandClass
Throws java.lang.IllegalArgumentException
if commandClass
is not a subtype of the root Command
this builder was created with
Match any command which the given predicate
returns true for
Match any command which equals exactly
Match any command which equals exactly
Throws java.lang.IllegalArgumentException
if exactly
is not a subtype of the root Command
this builder was created with
Register message handler for ReceiveTimeout
messages.
Register message handler for ReceiveTimeout
messages.
If a handler for ReceiveTimeout
messages was previously defined this will
replace the previous handler.
Register message handler for Terminated
messages.
Register message handler for Terminated
messages.
If a handler for Terminated
messages was previously defined this will
replace the previous handler.
Register message handler for timer messages.
Register message handler for timer messages. Timers are started through getTimers
on akka.persistence.multidc.javadsl.ReplicatedEntity#ActorContext.
Adding a handler for a timer message class that was previously defined will replace the
previous handler for that class.
Mutable builder for Java CommandHandlers. Handling of commands are added with the
match
methods and finally a CommandHandler is created with CommandHandlerBuilder#build.Match statements are appended and evaluated in order, the first one to match is used. If no match is found when evaluating the built CommandHandler for a given command a scala.MatchError is thrown.
Instances should not be created by user code but instead accessed through ReplicatedEntity#commandHandlerBuilder.