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 state
Match any state
Builds and returns the handler since this will not let through any states to subsequent match statements
Match states that are equal to the given state
instance
Match any state which is an instance of S
or a subtype of S
and for which the predicate
returns true
Match any state which is an instance of S
or a subtype of S
and for which the predicate
returns true
Throws java.lang.IllegalArgumentException
if stateClass
is not a subtype of the root State
this builder was created with
Match any state which is an instance of S
or a subtype of S
Match any state which is an instance of S
or a subtype of S
Throws java.lang.IllegalArgumentException
if stateClass
is not a subtype of the root State
this builder was created with
Match any state that the predicate
returns true for.
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 nested Java CommandHandlers where different states should have different command handlers. CommandHandler per state are added with the
match
methods and finally a CommandHandler is created with ByStateCommandHandlerBuilder#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 state a scala.MatchError is thrown.
Instances should not be created by user code but instead accessed through ReplicatedEntity#commandHandlerBuilder.