Class

akka.persistence.multidc.javadsl

ByStateCommandHandlerBuilder

Related Doc: package javadsl

Permalink

final class ByStateCommandHandlerBuilder[Command, Event, State] extends SignalHandlerBuilder[Command, Event, State]

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.

Linear Supertypes
SignalHandlerBuilder[Command, Event, State], AnyRef, Any
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ByStateCommandHandlerBuilder
  2. SignalHandlerBuilder
  3. AnyRef
  4. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from ByStateCommandHandlerBuilder[Command, Event, State] to any2stringadd[ByStateCommandHandlerBuilder[Command, Event, State]] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (ByStateCommandHandlerBuilder[Command, Event, State], B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from ByStateCommandHandlerBuilder[Command, Event, State] to ArrowAssoc[ByStateCommandHandlerBuilder[Command, Event, State]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. def build(): CommandHandler[Command, Event, State]

    Permalink

    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.

    Definition Classes
    ByStateCommandHandlerBuilder → SignalHandlerBuilder
  8. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. def ensuring(cond: (ByStateCommandHandlerBuilder[Command, Event, State]) ⇒ Boolean, msg: ⇒ Any): ByStateCommandHandlerBuilder[Command, Event, State]

    Permalink
    Implicit information
    This member is added by an implicit conversion from ByStateCommandHandlerBuilder[Command, Event, State] to Ensuring[ByStateCommandHandlerBuilder[Command, Event, State]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  10. def ensuring(cond: (ByStateCommandHandlerBuilder[Command, Event, State]) ⇒ Boolean): ByStateCommandHandlerBuilder[Command, Event, State]

    Permalink
    Implicit information
    This member is added by an implicit conversion from ByStateCommandHandlerBuilder[Command, Event, State] to Ensuring[ByStateCommandHandlerBuilder[Command, Event, State]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  11. def ensuring(cond: Boolean, msg: ⇒ Any): ByStateCommandHandlerBuilder[Command, Event, State]

    Permalink
    Implicit information
    This member is added by an implicit conversion from ByStateCommandHandlerBuilder[Command, Event, State] to Ensuring[ByStateCommandHandlerBuilder[Command, Event, State]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  12. def ensuring(cond: Boolean): ByStateCommandHandlerBuilder[Command, Event, State]

    Permalink
    Implicit information
    This member is added by an implicit conversion from ByStateCommandHandlerBuilder[Command, Event, State] to Ensuring[ByStateCommandHandlerBuilder[Command, Event, State]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  13. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  14. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  15. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  16. def formatted(fmtstr: String): String

    Permalink
    Implicit information
    This member is added by an implicit conversion from ByStateCommandHandlerBuilder[Command, Event, State] to StringFormat[ByStateCommandHandlerBuilder[Command, Event, State]] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  17. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  18. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  19. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  20. def matchAny(commandHandler: CommandHandler[Command, Event, State]): CommandHandler[Command, Event, State]

    Permalink

    Match any state

    Match any state

    Builds and returns the handler since this will not let through any states to subsequent match statements

  21. def matchExact[S <: State](state: S, commandHandler: CommandHandler[Command, Event, S]): ByStateCommandHandlerBuilder[Command, Event, State]

    Permalink

    Match states that are equal to the given state instance

  22. def matchState[S <: State](stateClass: Class[S], predicate: TypedPredicate[S], commandHandler: CommandHandler[Command, Event, S]): ByStateCommandHandlerBuilder[Command, Event, State]

    Permalink

    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

  23. def matchState[S <: State](stateClass: Class[S], commandHandler: CommandHandler[Command, Event, S]): ByStateCommandHandlerBuilder[Command, Event, State]

    Permalink

    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

  24. def matchState(predicate: TypedPredicate[State], commandHandler: CommandHandler[Command, Event, State]): ByStateCommandHandlerBuilder[Command, Event, State]

    Permalink

    Match any state that the predicate returns true for.

  25. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  26. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  27. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  28. final def onReceiveTimeout(handler: SignalHandler[ReceiveTimeout, Event, State]): SignalHandlerBuilder[Command, Event, State]

    Permalink

    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.

    Definition Classes
    SignalHandlerBuilder
  29. final def onTerminated(handler: SignalHandler[Terminated, Event, State]): SignalHandlerBuilder[Command, Event, State]

    Permalink

    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.

    Definition Classes
    SignalHandlerBuilder
  30. final def onTimer[M](messageClass: Class[M], handler: SignalHandler[M, Event, State]): SignalHandlerBuilder[Command, Event, State]

    Permalink

    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.

    Definition Classes
    SignalHandlerBuilder
  31. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  32. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  33. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  34. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  35. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  36. def [B](y: B): (ByStateCommandHandlerBuilder[Command, Event, State], B)

    Permalink
    Implicit information
    This member is added by an implicit conversion from ByStateCommandHandlerBuilder[Command, Event, State] to ArrowAssoc[ByStateCommandHandlerBuilder[Command, Event, State]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Inherited from SignalHandlerBuilder[Command, Event, State]

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd from ByStateCommandHandlerBuilder[Command, Event, State] to any2stringadd[ByStateCommandHandlerBuilder[Command, Event, State]]

Inherited by implicit conversion StringFormat from ByStateCommandHandlerBuilder[Command, Event, State] to StringFormat[ByStateCommandHandlerBuilder[Command, Event, State]]

Inherited by implicit conversion Ensuring from ByStateCommandHandlerBuilder[Command, Event, State] to Ensuring[ByStateCommandHandlerBuilder[Command, Event, State]]

Inherited by implicit conversion ArrowAssoc from ByStateCommandHandlerBuilder[Command, Event, State] to ArrowAssoc[ByStateCommandHandlerBuilder[Command, Event, State]]

Ungrouped